c# basic out of scope problem
Go to solution
Solved by noisebomb44,
37 minutes ago, Nineshadow said:Well yes , I was writing in C++ , my bad. I'm just used to writing everything in C++ and forgot this was about C#. Anyway, I think it would be like this :
int[] test = new int[9]; public static void scoreCreate() { test[0] = 0; //etc string[] name = new string[9]; name[0] = "noname"; //etc updateScores() } static void updateScores() { if (5 > test[0]) { etc } }
Didnt work, BUT, i found the answer on annother site, by using classes
working code (even simpler example this time):
public static class GlobalValues
{
public static int testvalue = 1;
}
public static void test()
{
Console.WriteLine("numer " + GlobalValues.testvalue);
Console.ReadLine();
}
Thanks for all the help though!

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now