From your other message
> I've installed turboc 3.0
This is an old compiler (really old) - you will have trouble accessing files if your operating system is win9x, NT, 2K, etc.
You will have this problem if
- any part of the path is a long filename
- any part of the path contains spaces (or any other char which DOS disallowed)
For instance, my "Program Files" directory has both a space, and is a long name. If I use explorer to look at the properties of this directory, I see the DOS filename is "PROGRA~1".
If this is your case, then try
fp=fopen("d:\\progra~1\\try1.c","r");
Code:
fp=fopen("d:\\programs\\try1.c","r");
if ( fp == NULL ) {
perror( "Cannot open file" ); // find out why
exit( 1 );
}
As you seem to have access to vc++, I'd stick with that, because you're going to find more things wrong with that old compiler (wrong because its on the wrong operating system).