I want to get timestamp for my log in c. i have written a function to get timestamp. But when i return the variable i m getting different value.
My code:
<
buffer[16] is a local array, which stops existing at the end of char* get_timestamp() function. Then you return a pointer to an array that does not exist.
buffer[16]
char* get_timestamp()