-
time(0)
what is the (0) in there for? I've only used time() for seeding the random number generator, and i was just wondering what exactly the 0 is for
i read this definition, but I don't understand it... which argument? is 0 the argument? if so then how is time stored in 0? :confused:
-
I've never seen `time(0)', I only see `time(NULL)'. :)
see more or `$ man 2 time'.
-
The argument to time can be either a pointer to time_t, or a null pointer. Most of the time people will use it with the null pointer and use the return value to assign to a time_t variable. In C++ the use of the macro NULL is not recommended, so the integer literal 0 is used because in pointer context it is treated as a null pointer. To summarize: time ( 0 ) and time ( NULL ) are equivalent. But time ( 0 ) is recommended over time ( NULL ) in C++.
-
oh, i see now... thanks ;)