0
time() function
Why is its operand 0 ? Can it have any other operand?
3 odpowiedzi
+ 5
see here: http://www.cplusplus.com/reference/ctime/
Basically it has two functions. The first is to return the current system time.
The second is it can give this returned time to an object of type time_t
such as
time_t myTimer;
time(&myTimer);
We use 0 to tell it not to assign the time anywhere but just return it.
+ 2
Like jay explained, this 0 is here simply to make the time function return to nothing...
Basically 0 represents NULL here, to make the function pass the value to a null pointer which has no memory...
+ 1
Thanks!