-
Problems With My Project
Code:
#include <iostream>
using namespace std;
int main(){
char a,b,c,d,e,f,g,h,i,j,k;
cout << "Please enter your first name\n";
cin >> a >> b >> c >> d >> e >> f;
cin.ignore();
cout << "You entered -"<< a << b << c << d << e << f;"- Is this correct?\n";
cin.get();
}
I'm trying to get this project to display the name that a user types and then ask if its correct. It displays the name but doesn't ask if its correct. I'd appreciate your help.
-pat3lbr0s2014-
-
You should use a string, not individual chars.
-
Quote:
Originally Posted by
pat3lbr0s2014
Code:
#include <iostream>
using namespace std;
int main(){
char a,b,c,d,e,f,g,h,i,j,k;
cout << "Please enter your first name\n";
cin >> a >> b >> c >> d >> e >> f;
cin.ignore();
cout << "You entered -"<< a << b << c << d << e << f;"- Is this correct?\n";
cin.get();
}
The character I made bold is wrong here and should be replaced by two others...