Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 9th, 2005, 9:38 AM   #11
Animatronic
Programmer
 
Join Date: Jun 2005
Posts: 99
Rep Power: 4 Animatronic is on a distinguished road
Quote:
Originally Posted by Klarre
Yes, it is just for learning. Actually I read about that function, and thought that "I do it myself instead"! I am also coding for BeOS, so I want portable code.

Thanks anyway!
Ah k, just wanted to check, parsing can be a good learning experience, I would go with Infinite Recursion though and stay any from char* as much as posible. Win32 maybe not the best option if you want portable code .
Animatronic is offline   Reply With Quote
Old Aug 9th, 2005, 10:36 AM   #12
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 301
Rep Power: 4 Klarre is on a distinguished road
Quote:
Originally Posted by Infinite Recursion
I would normally use the 'string' data type in this instance, instead of char*
Me too. But the getline(...) function does not return an std::string. There is the problem.
Klarre is offline   Reply With Quote
Old Aug 9th, 2005, 10:55 AM   #13
Animatronic
Programmer
 
Join Date: Jun 2005
Posts: 99
Rep Power: 4 Animatronic is on a distinguished road
<string> has its own getline:

	std::ifstream ifile("bla.txt");
	std::string s;

	std::getline( file,s,'[' );
Animatronic is offline   Reply With Quote
Old Aug 9th, 2005, 12:33 PM   #14
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 301
Rep Power: 4 Klarre is on a distinguished road
Quote:
Originally Posted by Animatronic
<string> has its own getline
Ah! Great! Didn't knew that! Thanks! That made it much easier.
Klarre is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:06 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC