18.02.2016, 14:43
First one appears because its a never ending loop so you'll never get to return -1.
The second one is what compiler expects to get but it doesn't know ots an infinite loop.
To avoid, you'll need a limit (some max/min value) for your loop.
The second one is what compiler expects to get but it doesn't know ots an infinite loop.
To avoid, you'll need a limit (some max/min value) for your loop.