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!

Help with fstream?

Status
Not open for further replies.

Innercynic

Programmer
Apr 7, 2006
1
NZ
hi, im new to programming, i would like to write a simple program that accesses a text file (a game .ini) and searches for and changes one value in it.
the format of the ini file is:

bForceMultiPass=1
bDoTexturePass=1
bDoSpecularPass=1 etc etc etc...

basically i would like to write a program in c++ that opens the file (perhaps asks for the files path), searches for and changes the value of bDoSpecularPass (to either 1 or 0 depending on what its current value is).

its little hassle to do what the program would do manually, this is only for helping with my c++ knowledge.

thanks
 
What part of fstream are you having problems with?

You should probably be using the getline() function to read each line of the file into an STL string. Then you can parse the line to look for the proper values...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top