Thanks for some hints!
I am confused on how to echo a character to myself , and then check if it is valid.
Here is what I have so far.
What I want to want to add here is accept 10 characters where the first 1-9 are digits and the last character can be a digit OR an X.
I think I am using the wrong function here -- getline -- becuase I am trying to get one character at a time and validate it.
Any clues ???
Thanks,
Code:
#include <iostream>
#include <string>
using namespace std;
void main()
{
string input; // user's input for ISBN #
// Info about program
cout << "*** ISBN VALIDATOR ***\n\n"
<< "Enter an ISBN #.\n\n"
<< "Remember, it is 10 SEQUENTIAL digits,\n"
<< "OR 9 SEQUENTIAL digits and then an 'X'.\n\n";
cout << "Your ISBN #: ";
getline(cin, input, '\n');
}