Does not exist in current context (Visual C#) -


i have error coming saying; name 'map' not exist in current context. doing wrong? sorry quite new coding...

public partial class form1 : form {     public form1()     {         initializecomponent();     }      private void form1_load(object sender, eventargs e)     {         variables();     }      public static void variables()     {         string[,] map;         map = new string[140, 140];      }      public static void updatemap(string[,] map)     {         messagebox.show("a");     }      private void form1_keydown(object sender, keyeventargs e)     {         updatemap(map);      }   } 

create class variable string[,] map.

public partial class form1 : form {     public string[,] map;       ... 

so variable "map" accessible in all(non-static) methods of class


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -