Is there any way by which I can validate the data on pressing a key?
For example,
int n;
I want only numbers to go in this. When I press "a" or "s", alphabets should not even appear on the screen. Only integer data should appear. It can be done using ASCII codes.
In VB, we do it by using keyAscii. What's the way in C++?
Please provide a sample code...
Validating data on key pressing.
- z3r0aCc3Ss
- Fame ! Where are the chicks?!
- Posts: 700
- Joined: 23 Jun 2009, 16:00
- 14
- Contact:
Validating data on key pressing.
Beta tester for major RATs, all kinds of stealers and keyloggers.
Learning NMAP
Learning NMAP
Re: Validating data on key pressing.
well one way you can do it is to use isdigit() to check if it's a character or a valid decimal digit.
Code: Select all
http://www.cplusplus.com/reference/clibrary/cctype/isdigit/
"The best place to hide a tree, is in a forest"