0
#include <bits/stdc++.h>    
using namespace std;

int main()
{
    string s;
    getline(cin, s);
    cout << s << endl;
    return 0;
}

I think it will help someone with my question and answer.

3
  • 1
    Can you elaborate? Commented Feb 7, 2017 at 1:24
  • You forgot to #include <string>. Commented Feb 7, 2017 at 8:50
  • #include <bits/stdc++.h> including this header file all necessary header file has been included. Commented Feb 17, 2017 at 10:02

1 Answer 1

2

In the code you showed, I think pressing only the Enter key will return an empty string.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.