Why am I getting this error: not all code paths return a value?

前端 未结 5 1578
长发绾君心
长发绾君心 2021-01-16 21:15

hi im new to c# and was trying to code but getting error can anybody help me with this what am i doing wrong?

using System;
using System.Collections.Generic         


        
5条回答
  •  借酒劲吻你
    2021-01-16 21:55

    What happens if I call isHodder(1)? Which return statement do I reach?

    We may never enter the for loop at all (or if we do enter it, the compiler can't be sure that we reach a return statement before we leave the loop).

提交回复
热议问题