Answer the question
In order to leave comments, you need to log in
How to completely clear the standard input stream in VS 2015?
Can't clear input stream. In the 2013 version, the cin.sync() function worked for me. In the 2015 version, I can't understand how the standard input stream works at all.
cin >> a;
cin >> b;
а
both b
are strings, then with input data, for example, "уквкп пвапк"
, the а
string must appear "уквкп"
in , and in b
- "пвапк"
. In the line а
, everything is as it should be, but in the line there b
is only the end-of-line character. Explain someone.
Answer the question
In order to leave comments, you need to log in
In the 2015 version, I can't understand how the standard input stream works at all.
#include <iostream>
#include <string>
int main()
{
std::string a, b;
std::cin >> a;
std::cin >> b;
std::cout << "a=" << a << " b=" << b << std::endl;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question