// Open file for writing if ( (fp=fopen(file_name, "w"))==NULL) { printf("Can't open file_name\n"); exit(1); } // Put single char in file fputc( cc, fp ); // Read chars from a file, up to EOF while (( cc = fgetc(fc)) != EOF ) // Read chars form a binary file, up to true-EOF while ( !feof(fp) ) { cc = fgets(fc); } // fwrite - used to wirte binary data to a file pointer fwrote( // write to a file &num, // data starting address sizeof(float), // chunck size to write 1, // number of chunks fp // address of file to write to ) // fread - use to read binary data from a file pointer fread( // read from a file &num, // read to address of variable num sizeof(float), // chunck size to read 1, // number of chunks fp // address of file to read from )