CLion removes spaces with cin when running
Answered
This doesn't happen on visual studios. I'm new to programming with c++ and it only appears to be happening in CLion. If I try to do something like:
int main()
{
cout << "Type in a number: ";
double number;
cin >> number;
cout << "\nWas your number " << number << "?";
}
When I run it and type in a number, it shows:
"Type in a number:123" instead of "Type in a number: 123"
Even though I have a space after the colon, it appears CLion removes it. Can someone help me?
Please sign in to leave a comment.
Hello!
Do you use MinGW or MSVC toolchain in CLion? If yes, the issue might be related to https://youtrack.jetbrains.com/issue/CPP-17579.
Thank you so much! I did your workaround in the registry and it worked!