By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,148 Members | 1,342 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,148 IT Pros & Developers. It's quick & easy.

-------opening Files In C---------

P: 6
Hi friends,

The boralnd turbo C compiler that I have doesnot seem to support "#include <fstream> " .....I want to open/read a text file(say from notepad) in C .....

I am able to open it C++ but not in C........plaz help..

Any suggestion wud be very helpful..

Thanks and Regards,

Arun
Mar 21 '07 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 1,510
in C you use the functions in <stdio.h>, e.g.fopen()
http://www.cplusplus.com/fopen
Mar 21 '07 #2

saranjegan
P: 51
Hi friends,

The boralnd turbo C compiler that I have doesnot seem to support "#include <fstream> " .....I want to open/read a text file(say from notepad) in C .....

I am able to open it C++ but not in C........plaz help..

Any suggestion wud be very helpful..

Thanks and Regards,

Arun
you can open a text file in C using fopen function initialized in stdio.h ,no need of fstream.h

fopen("path of file name",mode to be opened);

mode may be read "r" or write "w" or append use respective notation
Mar 21 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.