Hope this is right forum to post. Microsoft forums are so chaotic...
I Am trying to execute simple C++ program in VS community 19 on Windows 10.
#include <iostream>
int main()
{
int j{ 0 };
int x{ 0 };
std::cout << "enter any number other than 5\n";
do {
std::cin >> x;
switch (j){
case 0:
std::cout << "enter any other number than 1\n";
break;
case 1:
std::cout << "enter any other number than 2\n";
break;
case 3:
std::cout << "enter any other number than 3\n";
break;
case 4:
std::cout << "enter any other number than 4\n";
break;
case 5:
std::cout << "enter any other number than 5\n";
break;
case 6:
std::cout << "enter any other number than 6\n";
break;
case 7:
std::cout << "enter any other number than 7\n";
break;
case 8:
std::cout << "enter any other number than 8\n";
break;
case 9:
std::cout << "enter any other number than 9\n";
break;
case 10:
std::cout << "enter any other number than 10\n";
break;
}
j++;
} while (x != 5 && j < 10);
if (x == 5) {
std::cout << "you entered 5 you scoundrel";
}
else
std::cout << "you are more patient than I Am!";
return 0;
}
Problem happens on runtime, when I enter number for a third time (case 3:), console hangs and nothing happens. I pressed ctrl+c and it threw some weird error and showed window, that sources are not available for module kernelbase.dll, or something. I tried to load sources, but it didn't help. Now same window isn't showing, but this shows after program execution.
PS: tell me how to rename post title, I don't know how would I even call this error!
Thanks for help.