Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File IO problem

Status
Not open for further replies.

plastic

Programmer
Jul 11, 2002
24
GB
Hi, Whenever I try to include iostream.h, istream.h or (yup you guesses it) ostream.h it gives me several errors in stdexcep. I use BCB 5. Please help! Yes i am using the right syntax. :D Thanx

Chris
 
What are the errors? I routinely use streams in my BCB5 programs.
James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
The errors look completely random to me. The 3 of them, regardless of what I use the above mentioned headers for, even if i just #include them, without actually using them, are:

stdexcep.h(51): E2303 Type Name Expected
stdexcep.h(122): E2303 Type Name Expected
iosbase.h(102): E2303 Type Name Expected


If you go to these line numbers, you can see they look random. Both errors in stdexcep are lines which open a new class with {. Does this mean stdexcep.h and iosbase.h are corrupt? Please help :S

Thanks In advance

Chris
 
I believe you need to be calling the namespace std. Put std:: in front of stream functions. For example,
Code:
std::ios_base::binary
. James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
This isn't really working :'( Thanks for your help so far. I'm trying to open a file, so how would I go about this anyway?
Thanks

Chris
 
Even when I just #include<iosteam.h> it gives me the error, even if i don't declare any functions from iostream or do anything with it, so I think it's somehow corrupted, and I didn't need to do this before.

Chris
 
I don't knoe if this is the problem but try
Code:
#include <iostream>
w/o the &quot;.h&quot;. Also, where are you including the file?
James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
Tried that, doesn't work, still gives the same error. I tried something stupid like #include <iostrea> to see if it would give the same error but it said &quot;Unable to include file......&quot; Oh well, thanks a lot for helping out. I guess maybe I'll steal a friend's iostream files and see if it works out. I'll tell ya if it doesn't.

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top