also, in your 'else' condition, you make a call to getline( )
Code:
else
{
sDemoActInFrame tempDemoAct;
sscanf ( temp, " %d : %d : %d : %d ",
&(tempDemoAct.frame), &(tempDemoAct.action), &(tempDemoAct.cursorX),
&(tempDemoAct.cursorY));
mDemoActList.push_back(tempDemoAct);
filestr.getline(temp,256);
which could be subsequently called again in your initial 'if' condition.. without any push_back( ) operations in between.. this will erase the original value of whatever 'temp' was holding.
Code:
while (temp[0] == '#' || temp[0] == '\r' || temp[0] == '\0' || temp[0] == '\n' || strlen(temp) == 0)
{
filestr.getline(temp,256); //Possible subsequent call to getline ( ) from a previous 'else' operation in the loop
}
also, i think this should be called before entering the loop.. instead of repeatedly creating new objects on every 'else' case loop iteration:
Code:
sDemoActInFrame tempDemoAct; //Create this object before entering the loop and reuse it as necessary