English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

any computer genius pls......

2007-03-08 00:54:02 · 2 answers · asked by navee 3 in Computers & Internet Programming & Design

2 answers

You need to be a little more specific...

If you need to open two files at the same time, just create two different handles for them.

2007-03-08 01:10:27 · answer #1 · answered by BigRez 6 · 0 0

You can open multiple files and access them simultaneously in C(or in any other programming language )...
Actually when a c program starts executing three files are already opened by the executable by default... the output stream( to which the printf function writes), the input stream( so you can input from keyboard using scanf) and one error stream to which you are supposed to write your error messages and which can't be redirected..

The number of open files is restricted only by the OS on which your program is executing and the memory available to your program..

So if you want to access many files at the same time.. you just create that many handles..And you can open different files in different modes..
That is one can be in read only mode and the other can be in append mode..



If you actually meant compare instead of check...
-->
open the files which you want to compare in read only mode(binary too) Then read one character each and compare ..If the comparision is succesfull till the end of files(both files must be of same length (there is a function which returns the filelength )).. then the two files are identical...

2007-03-08 09:23:17 · answer #2 · answered by thekillerkat 3 · 0 0

fedest.com, questions and answers