How to input a full name in C++ ?

asked 11 Feb '15, 23:20

Hemonto%20Akash's gravatar image

Hemonto Akash
417


/*Headers  Here*/
using namespace std;

int main ()

{

  string mystr;

  cout << "What's your name? ";

  getline (cin, mystr);

  cout << "Hello " << mystr << ".\n";

  return 0;

}
permanent link

answered 12 Feb '15, 05:35

ishahriyar's gravatar image

ishahriyar
9519

edited 12 Feb '15, 05:37

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×131

question asked: 11 Feb '15, 23:20

question was seen: 948 times

last updated: 12 Feb '15, 05:37