Probably a silly mistake I am doing here.
FILE *fp;
fp = fopen("test.txt", "a+");
fprintf(fp, time_stamp(),"FLAG 1, Timestamp : %s\n");
fclose(fp);
I am getting timestamp from a function But The file writing only timestamp, not the flag If I remove timestamp, FLAG 1 printing. But Not getting together. ie
Flag 1, Timestamp : 20141005141116
The output I am getting in test.txt like
20141005145640201410051456402014100514564020141005145640201410051456412014100514564120141
Not going to new line and print like:
Flag 1, Timestamp : 20141005141116
Flag 1, Timestamp : 20141005141117
Flag 1, Timestamp : 20141005141118
..... like that
Please solve this issue
gcc -Wall -Wextra -g). You would get a warning from the compiler, if using GCC...fprintf