Re: Problem with pointers while using localtime() and time()

Originally Posted by
jamadagni
I tried using
struct tm now = *localtime(&time(NULL));
struct tm now = *localtime(&time(NULL));
To copy to clipboard, switch view to plain text mode
instead of
time_t timval = time(NULL); struct tm now = *localtime(&timval);
time_t timval = time(NULL); struct tm now = *localtime(&timval);
To copy to clipboard, switch view to plain text mode
and got an error: Why?
What time(NULL) returns is not a left value so cannot be 'get-addressed'
, coz the return value is a temporary value and will be destroyed after the statement.
BTW can I know what the meaning of the 1136698157 number is?
read the manual please
1. Users don't have the manual, and if they did, they wouldn't read it.
2. In fact, users can't read anything, and if they could, they wouldn't want to.
Bookmarks