Solved

Header File

Posted on 1998-09-09
3
177 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 10 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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 use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

733 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