to write to a file, you need to open a file with fopen, write to the file using fwrite and than close the file using fclose. i give you an example. this will write whatever is in the "Mem" to a file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
//open the file
FILE *filePtr = fopen("Path_Of_File", "w"); //w tells you want to write to the file.
if(filePtr == NULL) //if somehow file fails to open return
{
return error;
}
char arr[64];
sprintf(arr, "%s", Mem);
//write to the file
fwrite(arr, sizeof(char), strlen(arr), filePtr); //you can check, if the write is successful
//close the file
fclose(filePtr);