Hello,
No, int variables and character / string variables are different types. You want to do something like this:
// Have to declare values and [size]
// Note that size must be large enough to handle the
// projected size of the word/sentance *and* the return character
// Overloads will overwrite other data in memory (BAD!)
// Compilers might handle overloads differently.
{
char firstname[10], nextname[10];
cout << "Enter the firstname: ";
cin >> firstname;
}
Now, you also wanted to compare if Firstname == Tom, and Nextname == Pam.
Couple things to remember:
Tom <> tom, Tom <> tOm <> TOm
Pam <> pam
Error checking, my friend!
In your studies, you may have heard of the string processing library. You should use one function to make all the data ALL CAPS or all smalls, and use another function to compare the strings. Here is a hint... strcmp
Good Luck,
Christian