?
Solved

Header File

Posted on 1998-09-09
3
Medium Priority
?
179 Views
Last Modified: 2010-04-02
I am using #include<fstream.h>  in my C++ program. compile error says that fstream.h not found, because it is not in /usr/include.

means,I have C compiler on my machine but not that header file.
why??????how to get?????
from where I can get that file
0
Comment
Question by:anilkumarv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Expert Comment

by:WxW
ID: 1172426
Linux ( or other UNIX implementations , as I might understood from your /usr/include ) probably do not have the fstream.h I don't know why , but I have this file ... if you want me to mail it .... mail to xmic@freemail.gr

P.S. Since you work on UNIX platforms , there is no guarantee that my file should work on your system .

0
 
LVL 11

Accepted Solution

by:
alexo earned 30 total points
ID: 1172427
The /usr/include probably means you have a unix machine.

First, you have to make sure you have a C++ compiler on your machine.  A C compiler will not compile a C++ program no matter how nicely you ask.

Second, the newer C++ compilers follow the standard's practice of ommiting the .h suffix on the standard include files.  Try #include <fstream> instead.

Third, the include files may reside on a different directory.  Search your disk for fstream or fstream.h and tell the compiler to use the directory one of those files resides in as its include directory.  It can be done using a command-line switch (usually -i or -I) or an environment variable, depends on your compiler.
0
 

Author Comment

by:anilkumarv
ID: 1172428
Thanks, alexo
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question