Answer the question
In order to leave comments, you need to log in
How to count the whole line except the first character in the console?
How to read the entire line except for the first character in the console, or how to read the entire line into an array
How to read from the console, and not from a file
Answer the question
In order to leave comments, you need to log in
#include<iostream>
#include<algorithm>
#include<iterator>
#include<string>
using namespace std;
string getOneStr(istream& is)
{
string result;
copy(++istreambuf_iterator<char>(is), {}, back_inserter(result));
return result;
}
int main()
{
cout << "Enter the line (Win Ctrl+Z or Lin Ctrl+D end)\n$: ";
string s = getOneStr(cin);
cout << s << endl;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question