c# - The name "xx" does not exist in the current context -


my program keeps getting error "the name "ok" not exist in current context." doing wrong?

namespace game {     class program     {         static bool selftest()         {             bool ok = gamemodel.selftest();              if (ok)                 system.diagnostics.debug.writeline("succeded");             else                  system.diagnostics.debug.writeline("failed");              return ok;         }          static void main(string[] args)         {             bool ok = selftest();         }     } }  namespace game {     class gamemodel     {         public static bool selftest()         {             ok = true;              return ok;         }     } } 

change

public static bool selftest() {     ok = true;      return ok; } 

to

public static bool selftest() {     bool ok = true;     return ok; } 

or perhaps just

public static bool selftest() {     return true; } 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -