whats the code or functionn that checks that the user has enter the integer as the input.if other than that ask the user again to enter the number again.
Thanx! in hurry.
whats the code or functionn that checks that the user has enter the integer as the input.if other than that ask the user again to enter the number again.
Thanx! in hurry.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
Since im in a good mood ill give u a hint.
::hope i dont get punished by any mod by doing this::
Ask the user for an integer ......then use scanf or whatever to read from stdin. Afterwards you check the value of the "integer" to see wether its a real integer by using......is_it_an_int()
....by using isdigit(int try_to_post_some_code_next_time) or isalpha().
Make sure that u include ctype.h. Oh oh almost forget to make sure that the app asks for an integer again when the user didnt entered one you have to do all of this in a loop (wich one is up to you).
Originally Posted by Salem
If your'e going to use scanf() to get the input, look here:
Code:if(!scanf("%d",&myInt)) { //invalid input, the user didn't entered integer } else { //valid input make here, whatever you want }
Well god diggity--damn made my day Vber .
Thats a lots easier
Originally Posted by Salem