So i wrote this program to be sent as a practical joke, and ive reduced the errors to this:"Expected ';' before string constant"
there are 3 of them and i dont exactly know what is wrong.
here is the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
int name,DateOfBirth,PlaceOfBirth;
cout<<"Please enter your name:\n";
std::cin>>name"\n";
cout<<"Hello, "<<name<<", please enter your date of birth:\n";
std::cin>>DateOfBirth"\n";
cout<<"Now enter your place of birth:\n";
std::cin>>PlaceOfBirth"\n";
cout<<"Thank you, "<<name<<", your identity has just been stolen.\n";
cout<<"Have a nice day, formerly "<<name<<".\n";
cout<<"Program Terminated\n";
system ("PAUSE");
return 0;
}
the errors are on lines 8, 10, and 12. your help is much appreciated, thank you.
ok, thank you, but now when i execute the program, i enter my name, and is refers to me as "2".
then when i hit enter, it causes the rest of the dialogue appear automatically. any pointers there?
Well, your question doesn't make much sense, but from what I can tell, you're asking me if an integer must have a numerical value. The answer is yes, but, it's not always safe to access this value:
1 2 3 4 5 6 7
int a; //a is uninitialized
int b=a;
/*
The behavior here is system-dependent. Some systems let you get away with it,
but Windows XP, for instance, detects this as a runtime error and crashes the
program.
*/
ok, to rephrase, even though you already answere my question,
"can i store a name with an integer, or does it have to have numerical value?"
that better?