+ 2
Why is it saying illegal instruction ?
8 odpowiedzi
+ 2
You can fix that by declaring the functions as void:
void easy() {...}
void min() {...}
void hard() {...}
void insane() {...}
+ 3
#CODER
I tried flushing the input buffer to stop causing the infinite loop when given a wrong format by putting fflush(stdin) inside the default switch statement. It worked though
NB. I don't know why, but it only works when I use scanf to read the input instead of using cin
+ 2
I suspect that the program behaves weird, because you declared the easy, min, hard and insane function to return an integer, but they don't return anything anyways.
+ 2
There was also a risk for causing an infinite loop. When it asks for difficulty, and if wrong type of value was given, an infinite loop was caused.
+ 2
I don't actually know. The problem is, when an integer is required, but unnumeric characters were given.
+ 1
It worked !! Thanks !!
+ 1
How to fix that ?
+ 1
Hmm..weird