c++ - How can I read a file line content using line number -
i have following code snippet working fine: ifstream ndsconfig( "nds.config" ) ; string szconfigval ; while( getline( ndsconfig, szconfigval ) ) { //code } but problem need update check box state comparing line values. code similar following: ifstream ndsconfig( "nds.config" ) ; string szconfigval ; while( getline( ndsconfig, szconfigval ) ) { if(szconfigval == "autostart = 1") { //set check box true } else if(szconfigval == "autostart = 0") { //set check box false } if(szconfigval == "autloghistory = 1") { //set check box true } else if(szconfigval == "autloghistory = 0") { //set check box false } if(szcon...