Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I need help huys. I want C++

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi, I need help huys.

I want C++ to accept only numerical values from the user as input.
Other than that I want it to reject.

Example of how I would like it to work.

>Enter number: //User would enter number,anything else reject.

 
SYNOPSIS
#include <ctype.h>

int isalnum (int c);
int isalpha (int c);
int isascii (int c);
int isblank (int c);
int iscntrl (int c);
int isdigit (int c);
int isgraph (int c);
int islower (int c);
int isprint (int c);
int ispunct (int c);
int isspace (int c);
int isupper (int c);
int isxdigit (int c);

DESCRIPTION
These functions check whether c, which must have the value
of an unsigned char or EOF, falls into a certain character
class according to the current locale.


, so get your input, and
isdigit(input)
As always, I hope that helped!

Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top