Created: 2022-07-10
Tags: #permanent
#include <stdio.h>
FILE *ptr;
int main()
{
// Create a pointer for the file
FILE *ptr;
// Open file and assign it to pointer variable
ptr = fopen("C:\\program.txt","w");
// Writes a text to the file
fprintf(ptr, "fprintf: Allows arguments to format string\n");
fputs("fputs: Just fprintf but can't format string\n", ptr);
fclose(ptr);
}