I have pulled a string from an input, and I have to execute a function on it depending on if the string is numbers or characters. I tried making a function file that can determine it, however I am getting an illegal expression error C2451:
Then based on the return I use the corresponding function. The error lies withinCode:int chooseMethod (string testStr){ for (int I = 0; I<10; I++){ if (testStr.substr(1,1) = I){ return 2;}} return 1; }
. What am I doing wrong, or is there a common/easier way to do this?Code:if (testStr.substr(1,1) = I)




Reply With Quote