Respuesta :

tonb
Here's an example using the safe fopen:

FILE* customer = NULL;
fopen_s(&customer, "test.txt", "w");
char* msg = "mary smith";
fwrite(msg, sizeof(char), strlen(msg), customer);
fclose(customer);