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

Read\Write To a File, need to use smallest includes possible.

Status
Not open for further replies.

Splatman

Programmer
Apr 7, 2003
1
GB
I am making a plugin for an aplication I use. I am using a map to store vaules in (its a String,Int map), I can get it working fine apart from my code to save the map, I can loop through with iterators fine, and can write to a file in the form

String
Int
String
Int
String
Int

where the string is the map key and int is the map data. I then ran into problems reading the data back in, Using streams it was working fine aslong as the string hand no space.The stream's include also provided one more problem, it increased the output dll filesize from 50Kb to 200kb, and I am trying to keep the dll as small as posible, I know 200k seems small these days but compared to other plugins it is huge. I can get it to output with Write file but readfile needs to know how much data I am reading in, but I have know idea how much the will be in the file.
 
I am a bit surprised that including iostream actually increased your program's size, if you're using Visual C++, the runtime library functions should be in the MSVCRT dll, not statically linked to your code.
 
I think the size of the STL stream library is somewhat larger than the old IO Stream library. You might want to look into that. Of course if your using other STL classes like <string> or <map> you may find it introduces more problems that it solves.

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top