how to get timestamp in c

后端 未结 5 984
情话喂你
情话喂你 2021-01-19 10:53

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:

<         


        
5条回答
  •  清酒与你
    2021-01-19 11:32

    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.

提交回复
热议问题