18.02.2016, 14:17
Hi, i wrote a function for making a calculation but it keeps giving warnings. I tried to fix warning but in that case it gives another warning. Those warnings doesn't affecting something but it's the only warning at my script and this is annoying me.
Code Option #1
Warning: warning 225: unreachable code (pointing "return -1;")
Code Option #2
Warning: function "stockname" should return a value
How can i get rid of that warning?
Code Option #1
Warning: warning 225: unreachable code (pointing "return -1;")
Код:
stock stockname(some params) { //my code here for(;;i++) { //more code if(...) return i; } return -1; }
Warning: function "stockname" should return a value
Код:
stock stockname(some params) { //my code here for(;;i++) { //more code if(...) return i; } }