- Joined
- Nov 22, 2009
- Messages
- 28
- Reaction score
- 0
I'm currently learning C++ and here's a very simple script i've coded:
It wont compile, and it says theres an error in line 13
and that the variable is undeclared. I'm thinking it's because the type variable "char" is not compatible with words but just 1 letter? or is it something else? Thank you all who answer.
Code:
#include <iostream>
using namespace std;
int main()
{
char name;
cout<<"Give me you're name and i'll tell you what kind of person you are!\n";
cout<<"Go ahead! Type it in:\n";
cin>> name;
if (name == zair) {
cout<<"You're a Fag!";
}
if (name == byron) {
cout<<"You must be sexy!";
}
else {
cout<<"Not as gay as zair...";
}
cin.get();
}
and that the variable is undeclared. I'm thinking it's because the type variable "char" is not compatible with words but just 1 letter? or is it something else? Thank you all who answer.
Last edited:

