c# - the name 'lanesList' does not exist in the current context -
static void createlanes() { (int = 0; < 3; i++) { laneslist.add(new lanes(i)); } }
im new code , wondering why keep giving me error.
thanks in advance
you forgot initialise lanelist before add elements it. try code:
static void createlanes() { list<lanes> laneslist = new list<lanes>(); (int = 0; < 3; i++) { laneslist.add(new lanes(i)); } }
or if initialise outside of method need pass parameter:
static void createlanes(list<lanes> laneslist) { (int = 0; < 3; i++) { laneslist.add(new lanes(i)); } }
Comments
Post a Comment