// FILE: ToDgtDrv.cpp // DRIVER FOR FUNCTION "ToDigit" #include #include "ToDigit.cpp" // Functions Used... // DETERMINES THE EQUIVALENT INTEGER FORM OF ITS CHARACTER INPUT bool to_digit (char, // IN: the character to be converted int&); // OUT: the integer form of ch (or -1) // Driver (not included in the text) int main () { // Local Data... char ch; int i; bool stat; // Get the digit to be converted a digit cout << "Enter a digit > "; cin >> ch; // If a digit was Entered, print out the result. if ((stat = to_digit (ch, i)) == true) cout << "The digit is " << i << "." << endl; else cout << ch << " is not a digit." << endl; return 0; }