The title may sound a bit confuse, but what I want to do is basicaly create a class, declare a public int with the default value of 0, then inside the Program class I permanently change the value of this variable in a function, and if I print this value using another function, it will print the value set in the first function. For example:
using System;
{
class Global
{
public int variable = 0;
}
class Program
{
static void Main(string[] args)
{
Global test = new Global();
test.variable = 10;
//it makes no sense in this code to use another function,
//but in my other project it does
Function();
Console.ReadLine();
}
static void Function()
{
Global test = new Global();
//should print 10
Console.WriteLine(test.variable);
}
}
}