i'm having this function:
this function creates a txt file called log.txt, in the path that the .c file exist. how can i specify a path in which the file will be created?
int logger(char *log_prefix,char *buffer)
printf("Logger: Logging Command...\n");
file = fopen("log.txt","a+"); // apend file (add text to a file or create a file if it does not exist.
//writes the "buffer" to the txt file and current time and log prefix ( either sent or received).
fprintf(file,"Time/Date:%s# Command %s = %s\n",ctime(&now), log_prefix,buffer);
printf("Logger: Command Logged, Check log.txt for more details.\n");