Beginner here, I've been practicing with strings and files, and I've been trying to generate this text file that has the current date as the file name, but for some reason, fopen doesn't generate the file. Any advice?
Here's my code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
main() {
FILE *fLog;
time_t actualtime;
struct tm *day;
char Date[13];
time(&actualtime);
day = localtime(&actualtime);
strftime(Date, 10, "%x", day);
strcat(Date, ".txt");
printf("%s", Date);
fLog = fopen(Date, "w");
fprintf(fLog, "Hello world");
fclose(fLog);
}