Hello world (snicker),
Ok I am on the ground floor of learning c++... (no kidding)
I am dabbling around with of course the "Hello World" code and I have used the following;
Code:
#include <iostream.h>
char name;
int main()
{
cout<<"Please enter your name \n";
cin>>name;
cout<<"You entered "<<name;
}
well it WILL ask for the name:
So I put "Anjari"
but the output will only show:
It will not show the full line "Anjari"
what am I doing wrong?
also... If I wanted to add the following:
Code:
#include <iostream.h>
char name;
char accept;
int main()
{
cout<<"Please enter your name \n";
cin>>name;
cout<<"You entered "<<name<<"\n";
cout<<"Was this Correct? (Y/N)";
cin>>accept;
}
It will completely ignore the "Was this Correct? (Y/N)"; part....
why?
Thanks in advance....
Anjari