Dec 11, 2012 at 5:17am UTC
what will i do if there is an error like this?
In function `int main()':
jump to case label
crosses initialization of `int hop'
crosses initialization of `int hip'
Dec 11, 2012 at 6:28am UTC
that's my program..can you help me fix the errors please?
it should be when user enters d ,the program ends..please help
Last edited on Dec 11, 2012 at 7:14am UTC
Dec 11, 2012 at 6:37am UTC
The problem is in
case 'C':
case 'c':
int hip=0;
int hop=1;
kindly rectify it as :
case 'C':
case 'c':
{
int hip=0;
int hop=1;
..
..
}
Dec 11, 2012 at 6:46am UTC
still it doesnt stop when i entered d:((
Dec 11, 2012 at 6:59am UTC
while (choices!='D' || 'd' );
This is not equivalent to choices != 'D' || choices != 'd'
, and will always evaluate to true. Were it equivalent, it still wouldn't be what you intended.
while ( !(choices == 'D' || choices == 'd' ) );
Last edited on Dec 11, 2012 at 7:04am UTC