473,395 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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
2 1301
horace1
1,510 Expert 1GB
in C you use the functions in <stdio.h>, e.g.fopen()
http://www.cplusplus.com/fopen
Mar 21 '07 #2
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

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

Similar topics

1
by: Jonathan Rubke | last post by:
I am getting a filename from one frame and opening it in another frame. It works fine if the file exists, but I'm trying to get it to show an error message, possibly an alert box, if the file...
5
by: PM | last post by:
Has anyone found a way to open a file exclusively where it will fail if the file is already open, i have tried the following _FileStream = new FileStream(@"C:\Data.txt", FileMode.Open,...
0
by: Stephen | last post by:
could someone give me some advise on a problem I have. At present i have a web application which displays pdf files in a web browser using javascript and the window.open method and pointing to a...
1
by: Ddraig | last post by:
Howdy, I was wondering if anyone could point me in the direction of some good code that will look at a folder of various text files, read in the names and then open them. For example opening...
2
by: Asprisa | last post by:
Hi There, This is probably an easy one! i am having trouble opening the files listed in a filelistbox, they are all .url files, all i want them to do is open up in the default browser, i looked...
5
by: muwie | last post by:
Hello, I was browsing to see if I could find something similair to my problem. But I couldn't find anything.. I have this script that counts every word in a file. And then also says how many...
1
by: Jonno85 | last post by:
Hi, I have developed a file directory to show files on one of our servers, but am experiencing problems when it comes to opening and saving files. I would like it so that when a user opens a file,...
0
by: Alexnb | last post by:
Okay, so what I want my program to do it open a file, a music file in specific, and for this we will say it is an .mp3. Well, I am using the system() command from the os class. The problem I am...
34
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File...
4
by: yjulien | last post by:
Hello guys, I have not figure out how to properly use the read/write mode for opening files +>, +<, +>> I tried it but always got unpredicatable output. I usually do this for standard...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.