WriteInt
Writes integer value into the specified section of an initialization file
void WriteInt( LPCSTR lpcszSection, LPCSTR lpcszKey, int nValue )
EX1
//This example writes integer value into the Config section of MyOrigin.ini. //For this example to run, a file with followint content named MyOrigin.ini should exist under C:\ folder. //[Config] //ShowState=1 void INIFile_WriteInt_ex1() { int iState = 3; INIFile iniMyF("C:\\MyOrigin.ini"); iniMyF.WriteInt("Config", "ShowState", iState); printf("Set initial Origin window state to %d\n", iState); if (iState == iniMyF.ReadInt("Config", "ShowState", -1)) printf("Success!\ninitial Origin window state is %d\n",iState); else out_str("Error!"); }
origin.h