ios_base (where is this file)

S

Steven Taylor

I'm learning C++ and am using a simple IDE to enter code.
My code is as follows.

#include <iostream>
#include <fstream>
#include <cstdlib>
void file_it(ostream &os, double fo, const double fe[],int n);

using namespace std;
int main()
{ //...simple code...// }

void file_it(ostream & os, double fo, const double fe[], int n)
{
ios_base::fmtflags initial; // <<<< compile error here
initial = os.setf(ios_base::fixed); // save initial formatting state
....
}
Using my preferred ide (C-free) I get a compile error "ios_base"
undeclared. When copying the exact code into Borland C++ BuilderX and
another simple ide 'Quincy' they compile perfectly. Any advice would
be appreciated (I know I can use my other compilers, but I would like to
know what is not happening).

Steven Taylor
Melbourne Australia.
 
S

Sharad Kala

Steven Taylor said:
I'm learning C++ and am using a simple IDE to enter code.
My code is as follows.

#include <iostream>
#include <fstream>
#include <cstdlib>
void file_it(ostream &os, double fo, const double fe[],int n);

using namespace std;
int main()
{ //...simple code...// }

void file_it(ostream & os, double fo, const double fe[], int n)
{
ios_base::fmtflags initial; // <<<< compile error here
initial = os.setf(ios_base::fixed); // save initial formatting state
....
}
Using my preferred ide (C-free) I get a compile error "ios_base"
undeclared. When copying the exact code into Borland C++ BuilderX and
another simple ide 'Quincy' they compile perfectly. Any advice would
be appreciated (I know I can use my other compilers, but I would like to
know what is not happening).

<ios> is the file you are looking for. It describes the base class of the
hierarchy and is usually automatically included by other header files of the
library that contain the derived classes.

Sharad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top