[Dev-C++] More: Reading file with getc(fp)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: rchavez <rc...@so...> - 2002-04-11 01:45:28
|
Hi,
Thanks for the replies. I added a check for NULL file pointer and found
that indeed it is NULL. That explains why the same code works in unix but
not in Dev-C++. (In my defense I took the example directly from a book.)
So 2 new questions:
1. If the source file & the target file to be read are in the same
directory I am using in Dev-C++, shouldn't
fopen("filename","r") find the file? It doesn't seem to.
2. Is
fopen("C:\Dev-C++\Dir1\Dir2\filename","r") a valid explict path syntax in
Windows 2000 ? (assuming Dir1 & Dir2 already exist)
There must be a better book for re-learning C than "A Book on C" or K&R!
Regards,
Rob.
|