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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with streamreader!

Status
Not open for further replies.

A1METALHEAD

Programmer
May 21, 2004
76
0
0
US
ok, i have VC++ .net 2002 and i am trying to parse a text file. so far i cant use the way i used when i wrote this in C# with the streamreader. this is my code:
Code:
		FileStream* fs = new FileStream("c:\\database.txt",FileMode::Open);
			IO::StreamReader* sw = new StreamReader(fs);
			String* fileIo = sw->ReadLine();
			bool end = false;
			while(end == false)
			{
				String* line = ;
				cout<<line;
				if( line == 0 ) end = true;
			}
and whenever i try and run it, it outpuits a bunch of ones! i want it to acualr read the line.
thanks,
~metalhead
 
oh, sorry, this is the code:
Code:
			FileStream* fs = new FileStream("c:\\database.txt",FileMode::Open);
			IO::StreamReader* sw = new StreamReader(fs);
			String* fileIo = sw->ReadLine();
			bool end = false;
			while(end == false)
			{
				String* line = sw->ReadLine();
				cout<<line;
				if( line == 0 ) end = true;
			}
 
oh. i got it... sorry. i guess cout dosent work with Strings very well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top