#include
#include
using namespace std;
int main()
{
string str1, str2, str3;//How about using a real string object?
cout << "enter your first name" << endl;
cin >> str1;
cout << "enter your last name" << endl;
cin >> str2;
str3 = (str1 + " " + str2 + "\n");//Adds a space between and the newline we stripped.
cout << endl; // Screen space is free, use some;-)
cout << str3 << endl;
return 0;
}
I hope this will help you out. Good luck!
here's the code:
#include
#include
#include
#include
int main()
{
char str1,str2, str3;
cout<<"enter your first name"<
cin>>str1;
cout<<"enter your last name"<
cin>>str2;
str3=str1+str2;
cout<
getch();
return 0;
}
when i'm running this code, after giving the input, its showin a symbl like half # as output. where m i misataking?