I'm a newbie with what seems to be a syntax issue in my user defined function.

Currently my code --and the error is the following:

enter image description here

...the problem seems to be the semicolon at the end of line 39.

But when I delete the semicolon, I get 6 other errors:

enter image description here

*Is my problem in line 39 (and what is the problem), or is it somewhere else?

Thanks for any help that you can provide!

2 Answers 2


It is always preferable to publish the code than a screenshot, in case you have to reproduce the error, nobody is going to write your code, in this case the error is easy, it is simply a typo error:

int= i = 0

that should be

int i = 0

Thanks! Fixed it along with 2 others, here's the final:

bool check_valid_key(string s) { for (int i = 0, len = strlen(s); i < len; i++) if (!isdigit(s[i])) return false; return true; }

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .