I was playing with the time.h
file in C that helps us with time/day functions.
I came across:
struct tm * _Cdecl localtime(const time_t *__timer);
...which seems to return a pointer to tm struct. I have found that return by address is mostly used to return new memory allocations.
If this is so, how does the above return actually work (the return address of a struct tm
). Is the returned object defined somewhere?
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…