Developed this function to dump the string to file.
But when ever I call this, string is written into the same line. I want this into the next line. Can anybody suggest, what is going wrong in this..
Thanks,
Bye
Code:bool writetoLogFile(CHAR *buf) { bool bResult; ULONG nbytes; SYSTEMTIME st; char logData[280]; GetLocalTime(&st); GetDateFormat( 0, 0, &st, "ddd',' MMM dd,yy",logData, sizeof(logData) ); GetTimeFormat( 0, 0, &st, " hh':'mm':'ss tt", logData+14, sizeof(logData) ); strcat(logData,buf); logData[strlen(logData)] = '\0'; logData[strlen(logData)+1] = '\n'; bResult = WriteFile( hLogFile, logData, strlen(logData), &nbytes, 0); if ( 0 == bResult ) { printf("Can not write to log file\n"); return 0; } return 1; }