Vince Powers

Greenhorn
+ Follow
since Feb 14, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vince Powers

If the user enters a char instead of a required number as a command line argument, can this be handled by a simple if statement?

how do I compare a character to an integer?
19 years ago
Hi,

I have a rather simple delema. How do I check if the command line argument is of integer type without using try catch? I would like to test this with an if statement. The command line arguements are stored in an array.

Is it somthing like this:

if args[1] != (this is where I'm stuck. Hoe do I specify check for number or integer value. This should handle wrong input like if the user entered a char etc.

TKS
19 years ago