can anybody pls tell me how to pass FILE pointer in c. I am so confused .. :confused:
suppose I ve two function
file_open()
read_line()
I want to call these function from main() function and in file_open() function it will open that file and in read_line() function I ve take the file pointer from read_line() function then read line by line ..
I tried with code , but I am sure I am doing some stupid stuffs.. Pls Pls help me to get the code right.
It's usually to close the file after using it so the pointer can be used to access a different file.
If files are still open when a program exits, the system will close them. However it is usually better to close the files properly.
Systems have a limit on the number of files which can be open simultaneously, so it is a good idea to close a file when you have finished using it.