September 4th, 2003, 01:45 AM
how to prevent char input
i need the user to input an interger and then do some calculations on it, but i can't work out how to prevent them entering char, how would i do it?
printf("Please enter the number:\n");
// input validation here
September 4th, 2003, 03:54 AM
you could collect it as a char and then use
to ensure it is a number.
The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.