Hi there, I made a mistake when following along from the lecture where I accidentally wrote GuessB twice in the std::cin statements, which can be seen below:
int GuessA, GuessB, GuessC;
std::cin >> GuessA;
std::cin >> GuessB;
std::cin >> GuessB;
std::cout << "You entered: " << GuessA << GuessB << GuessC << std::endl;
Obviously I needed to change one of them to read std::cin >> GuessC. What I found strange though, is that my code did not crash. Instead when I entered an example code e.g. “2 3 4”, the console returned a large number of 7/8 digits instead of any of the user input values. My guess is that as I am declaring a variable ‘GuessC’ and printing it to the console in the final line of my example code, that the code gets confused as there is nothing left in the input stream for it to access, so it instead pulls a value from outside of the allocated memory space. Is this correct at all? If not I’d be really interested in finding out why this is happening as I find it to be very intriguing.