So I'm in class right now, using Visual C++ 6. I'm so close to finishing this module, but I need to know how to make a variable that holds two characters. What the goal of the program is, is to take the users province in two characters, then determine which area it's in (ie. Western provinces). I don't need anything too hardcore, because this is just supposed to b a simple project.
This here doesn't work. All it does it gets the first character, obviously, but I don't know how to create strings or modify the char variable if that's what's needed. If you help fast, maybe I can start the next module today :PCode:#include <iostream.h> #include <string.h> void main() { char sProv; cout << "Please enter you Province: "; cin >> sProv; //Get the province that the usProver isProv from cout << sProv; if (sProv == 'ab') { cout << "\nYou're in the Western provinces.\n" << endl; } else if (sProv == 'on') { cout << "\nYou're in the Eastern provinces.\n" << endl; } else if (sProv == 'nb') { cout << "\nYou're in the Atlantic provinces.\n" << endl; } }