| narcisa (8) | |
|
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' | |
|
|
|
| Disch (8337) | |||
put your case body in its own scope by adding {braces}
| |||
|
|
|||
| narcisa (8) | |
|
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
|
|
| VinayVerma (2) | |
|
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; .. .. } | |
|
|
|
| narcisa (8) | |
| still it doesnt stop when i entered d:(( | |
|
|
|
| cire (1845) | |
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
|
|