Code:
#include <stdio.h>
#include <time.h>
int main(void)
{
FILE *mystream;
char buffer[50];
time_t current = time(NULL);
struct tm* pLocal = localtime(¤t);
strftime(buffer, sizeof(buffer), "Report created %a %x at %X %p", pLocal);
mystream = fopen("output.txt", "w+");
fprintf(mystream , "------------------------------------------------\n"
"%s\n"
"------------------------------------------------"
, buffer);
fclose(mystream);
system("PAUSE");
return 0;
}
i studied anonytmouse's code modified and add to it a bit to make exactly what i wanted.
thanks alot guys. I never knew its gonna be as easy as this.