Skip to main content
GameDev.net gamedev.net
๐Ÿ”’ Locked

String and fstream question.

Started by The C modest god Jan 4, 2004 at 2:04 AM 1 replies 250+ views
Original Post
The C modest god
The C modest god
If I have a code like the following: string Name; ifstream File("file.in"); File>>Name; File>>Name; Will the string class free the memory it used for the string after the first File>>Name, so there wont be momery leak as a result of calling one after another File>>Name?
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower. Quote: Original post by Toolmaker Quote:
SiCrane
SiCrane
If I understand your question correctly, then, yes, there should be no memory leak.
randomZ
randomZ
That''s one of the points of the string class (and other STL containers): They take care of their memory themselves.


---
Just trying to be helpful.

Sebastian Beschke
Just some student from Germany
http://mitglied.lycos.de/xplosiff
---Just trying to be helpful.Sebastian Beschkehttp://randomz.heim.at/

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.