View Single Post
  #5 (permalink)  
Old August 23rd, 2004, 03:39 PM
mehdi62b mehdi62b is offline
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

sorry for my delay
(some points from logic)
(x!=1 || x!=2 || x!=3) is always true because
(x!=1 || x!=2 || x!=3)==![(x=1)&(x=2)&(x=3)]==!false==true
about checking your input why you want to restart your program everytime you can
skip wrong inputs until you get a valid input,you should do it something like below
Code:
char a;
a=getch();
while((a<'0')||( a>'9'))
{
a=getch();
}
//here a has a valid input
Hope I got your meaning correctly.
HtH.

--------------------------------------------
Mehdi.:)
Reply With Quote