I have code similar to this:
Techniclly, all above is fine, the function asks for a return value and would recieve it if option 2 was executed.Code:int menu() { switch ( do somthing ) { case 1: // blah break; case 2: return 0; break; } }
When I compile. I have several functions that ask for a integer value to be returned, and I do this, but get this bizzare warning:
I just dont understand it?main.cpp(400) : warning C4715: 'beginTheGame' : not all control paths return a value



LinkBack URL
About LinkBacks




"
CornedBee
). Luckily most good compilers I've seen should give a warning about "not all control paths return a value", although you might need to turn the warning level up beyond the default.