Which type of variable is What?
An std::string, with using namespace std; tacked on somewhere before.
Thanks.
Your line of code is interesting to me because it doesn't look like there should be a compile error, just an annoying lack of compile error and some unexpected value in 'What'?
std::string What = ("Option"+Alphabet[x]);
"Option" is a string literal, which should behave a const char array.
Alphabet[x] should be a char.
Now, a char is just a 1-byte integer, and a char array also acts like a char pointer, so I'd expect pointer arithmetic out of this.
To confirm, I added this to a piece of code I had open:
std::string Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int x = 4;
std::string What = ("Option"+Alphabet[x]);
There were no compile errors.
My expectation is that, because 'E' is some number beyond the string length of "Option", the assignment for string 'What' ends up filling itself from whatever happens to be in that memory location beyond "Option", until it hits a byte equal to 0.
Oh well, it feels like I'm probably just wasting your time. It's good you have everything working now.