Ask your own question, for FREE!
Computer Science 10 Online
OpenStudy (anonymous):

i really want a help in file handling.

OpenStudy (anonymous):

in turbo c++

OpenStudy (e.mccormick):

Start here and see how it goes: http://www.cplusplus.com/doc/tutorial/files/ This is good too: http://www.tutorialspoint.com/cplusplus/cpp_files_streams.htm And with files, an exception handler is a very good idea.

OpenStudy (anonymous):

simple code to read a file FILE * inputFile; // file type variable char c = NULL; //character type variable inputFile=fopen ("input.txt","r"); //opening the file in read mode (thats what "r" means) while (c != EOF){ // checking if end of file has reached c = fgetc (inputFile); // getting next character from the file //rest of code here } In the similar way you can create code for write & append :)

OpenStudy (anonymous):

inputFile=fopen ("input.txt","w"); // write mode inputFile=fopen ("input.txt","a"); // append mode

OpenStudy (anonymous):

the problem that i am having with file handling is that when i let the program to read a file it it runs without any error but display a blank screen @annas :(

OpenStudy (anonymous):

i really dont know where to put the file handling code in any code..

OpenStudy (anonymous):

can you show me your code so I can correct it ?

OpenStudy (anonymous):

post your code here

OpenStudy (e.mccormick):

Time to learn some debugging. Use a debugger and put a break point in around where the file is read so that you can see if things are actually being read in, OR do a similar thing with a print statement. Once you know the data is being read in you can move on to how it is processed and do the same thing. Just look at small, sequential parts of the program and fix them as you go. Don't try and debug or verify it all at once. Just start where the program is supposed to start, make sure that works, move to the next item, and so on.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!