Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Newbie question on time()
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Dan Pop, post: 1680494"] ^^^^^^^^^^^^^^^^^^ That's a bold statement for code invoking undefined behaviour: fangorn:~/tmp 427> cat test.c #include <stdlib.h> int main() { srand(time()); return 0; } fangorn:~/tmp 428> gcc -ansi -pedantic test.c fangorn:~/tmp 429> So, let's rephrase: "if the code includes <time.h>, the call you show above should not compile without a diagnostic". ^^^^^^^^^^^^^^^^^^^^ If the author was sloppy enough to call srand(time()), it is a safe bet that he was sloppy enough not to include <time.h>. Dan [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Newbie question on time()
Top