![]() ![]() ![]() fprintf(outfile,"%d\n %.3lf\n %s\n",input.a,input.b,input.dataStr) įwrite(&output,sizeof(FileData),1,outfile) Ĭode to convert from binary file to ASCII code fileįILE * infile=fopen("out_file. While( fscanf(infile,"%d %lf %s",&input.a,&input.b,&input.dataStr)=3) ![]() =Ĭode to convert from ASCII to binary fileįILE * outfile = fopen("out_file.txt","wb") įileData output // pointer for write file Many files reside on disk however, devices such as printers, magnetic tapes, and communication lines are also considered files. Tennyson A file is a collection of related data. Could you please advise on how to fix this problem? Thank you very much. ISBN: 9-2 Chapter 16: File Input/Output I am the heir of all the ages, in the foremost files of time. My doubt is the fwrite function doesn't work probably. The code is able to read file and print data into other file as ASII code ( using fprintf) however, when I try to convert from ASII code to binary file ( using fwrite), and then use (fread) the file again. I have a problem of converting ASCII code file into binary file. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |