Files
Define file pointers with
FILE *fin, *fout;
Open file for read (the file must exist)
fin = fopen("in.dat","r");
Open file for write
fout = fopen("outfile.dat","w");
Use file pointers in fprintf and fscanf.
Close files with
fclose(fin);
fclose(fout);
Previous slide
Next slide
Back to first slide
View graphic version