|
-
September 21st, 2012, 11:16 AM
#1
nter first and surname and then display the full name problem
Hi
I'am new to C++, i done various basic programs in C++, but one program is giving me a major headache: enter first and surname and then display the full name:
code below:
// Enter first and surname and then display the full name.
#include<iostream>
#include<string>
#include<cctype>
using namespace std;
int main()
{
string first_name, surname;
int main()
{
inp_string
Pr_string
return 0;
}
void inp_string
{
cout << "Enter your first_name";
// cin >> first name;
getline(cin,first_name); // reads all the line plus spaces
cout << "enter your surname";
// cin >> surname;
getline(cin, suranme); // reads all the line plus spaces
system ("CLS");
}
void pr_string
{
cout << "My full name is " << name << "\n";
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|