I think str[i] when i == str.length() will generate an error in debug mode. This is actually not an error according to the latest C++ standard. Hopefully Visual Studio will fix this bug in future versions.
Then you wont have qualify these all throughout your code. That is you wont have to put std::cout everywhere for example.
This is a matter of taste. I find it easier to just put std:: infront of everything. That way it's easy to see that the name is from the standard library and I don't have to put a lot of using directives everywhere.
for(int i = 0; str[i] != '\0'; ++i) // line 11 in your program
for (int i = 0; i < str.length(); i++) // might be better suited for your needs
1 2 3
if(x == str[i]) // this will NEVER execute.
// x is always equal to a 2 or 3 digit number in your program
// so comparing it to 1 character in a string isn't useful
1 2 3 4 5 6 7 8 9 10
else
{
continue;
}
// when you only have one line of code,
// you can write it like this:
elsecontinue;
// but anyways, this doesn't do anything either.
// what are your intentions with this else statement?