#include <stream.h>
int main() {
char year;
cout << "please give me the year (4-digit year) =====> ";
cin >> year;
if (isalpha (year)) {
cout << "The character " << year << "is \"isalpha\""; }
else {
cout << "The character " << year << "is not \"isalpha\""; }
}
################################################################################
cout << "Enter a number and a symbol and another number" << flush;
cin >> num1;
void getfloat(float & num1) {
char dummy; // reads from buffer into dummy in order to clear buffer
while (cin.fail()) {
cin.clear(); //if don't clear flag ignores all subsequent reads
cin >> dummy;
// if it's a q then you can exit
cin >> num1;
}
return;
}
return to top