Hi all,
I am new in c++ programming and I am trying to make some examples
But unfortunately I have some problems
My code is :
#include <iostream>
#include <string>
using namespace std;
int main()
{
string firstname, lastname, fullname;
cout << "First name: ";
cin >> firstname ;
cout << endl;
cout << "Last name: ";
getline (cin, lastname);
fullname = lastname + ", " + firstname;
cout << "Fullname: " << fullname << endl;
system("pause");
return 0;
}
I am using Dev-C++ so the line 'system("pause");'
The problem I have is that getline function does not work.
What am I doing wrong