September 25th, 2003, 12:16 AM
Linux C++ : how to write ini file
how can i access/write to ini file?In Visual C++ we can use WritePrivateProfileString function.. but in linux how i can do this..
September 25th, 2003, 01:08 AM
For accessing, see answers by mitakeet and Clifford:
Last edited by Scorpions4ever; September 25th, 2003 at 01:55 AM.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
September 25th, 2003, 04:29 AM
You write to an ini file just like you would write to any other file. Just because MS sees fit to produce some dumb library function doesn't mean that you have to use it. Throw off the shackles of Bill and learn to use real programming tools.
September 25th, 2003, 11:49 AM
Linux programs don't use .ini files, but rather .conf files (configuration files). There's nothing magical about them. They're just flat text files. Check out some of the .conf files under /etc for ideas about how they're formatted. Usually, a comment begins with the '#' character.
Read the thread that Scorpions pointed you to, since it contains some code for parsing a line from a .conf file.
September 25th, 2003, 08:36 PM
so that mean i can write/access that file like a normal file such as fopen,fget etc.. thanks everyone..