Skip to main content

Timeline for Event scheduler in C

Current License: CC BY-SA 3.0

25 events
when toggle format what by license comment
Mar 30, 2016 at 1:51 vote accept Insane
Mar 28, 2016 at 3:54 history edited Insane CC BY-SA 3.0
added blank newline back to the example save file
Mar 28, 2016 at 3:44 history edited Insane CC BY-SA 3.0
the disclaimer has already been cleared by another mod, please do not revert. thank you
Mar 28, 2016 at 3:40 history rollback Jamal
Rollback to Revision 6
Mar 28, 2016 at 3:38 history edited Insane CC BY-SA 3.0
added 155 characters in body
Mar 28, 2016 at 1:32 history edited Jamal CC BY-SA 3.0
deleted 126 characters in body
Mar 25, 2016 at 23:54 history edited Insane CC BY-SA 3.0
added 167 characters in body
Mar 25, 2016 at 15:10 history edited 200_success
edited tags
Mar 25, 2016 at 14:44 answer added raven timeline score: 3
Mar 25, 2016 at 6:28 comment added Matteo Italia @Insane: exactly; all caps with underscores is commonly used to signify preprocessor defines, but the leading underscore has to go.
Mar 25, 2016 at 5:20 answer added Digital Trauma timeline score: 5
Mar 25, 2016 at 4:23 answer added deamentiaemundi timeline score: 6
Mar 25, 2016 at 1:35 history tweeted twitter.com/StackCodeReview/status/713177424771551232
Mar 25, 2016 at 0:31 comment added Insane @MatteoItalia I read somewhere it's proper for #defines, as I did it, to be all caps with underscores, however starting it with an underscore probably isn't proper.
Mar 24, 2016 at 23:43 comment added Matteo Italia Names beginning with an underscore and followed by an uppercase letter are reserved for the C library implementation details; remove them from your #defines (also, even if they weren't reserved, why adding unnecessary noise in the name? I never understood why everybody is so fond of adding underscores at the start of names).
Mar 24, 2016 at 18:11 comment added coderodde @jamesqf My concern was not quite performance, but rather the aspect that it is hard to know whether your self-rolled solution is correct.
Mar 24, 2016 at 16:35 comment added jamesqf @coderodde: qsort might be overkill for the short lists that an event scheduler would use. Consider setup overhead, and worst-case performance when adding a new element to the already-sorted list - but maybe the OP would get extra credit for timing both methods :-)
Mar 24, 2016 at 16:12 comment added coderodde You might want to use qsort from stdlib.h for sorting the events.
Mar 24, 2016 at 13:10 answer added Caridorc timeline score: 9
Mar 24, 2016 at 13:04 answer added user101048 timeline score: 37
Mar 24, 2016 at 12:01 comment added akasummer yeah, strtol should be your preferred option, atoi is considered unsafe + no difference between error and zero value.
Mar 24, 2016 at 11:53 comment added akasummer At first glance: Try to input a letter into your range, atoi will return 0 and it will pass validation; You should use binary sort instead of insertion sort, then you can always keep your list sorted while inserting events. Also I didn't notice you freeing the memory, it will lead to memory leaks.
Mar 24, 2016 at 11:43 history edited Quill CC BY-SA 3.0
deleted 6 characters in body
Mar 24, 2016 at 11:38 history edited Insane CC BY-SA 3.0
added 188 characters in body
Mar 24, 2016 at 11:27 history asked Insane CC BY-SA 3.0