First of all I would like to apologize for such primitive question but I'm a complete beginner and I wasn't able to find a solution that I would understand.
I'm learning C# (because of Unity) and I wanted to experiment a bit and create a little program by myself. But after coding in "Basic" Visual Studio instead of "Unity" Visual Studio, I've stumbled on problem I couldn't fix nor understand.
string hello = "Hello, World!";
static void Main()
{
otherMethod();
}
void otherMethod()
{
Console.WriteLine(hello);
}
On Unity I could do this without problem because the Start method allowed non-static methods inside of it but now...
...if I change remove static from Main method the program won't run.
...if I add static to the otherMethod, the otherMethod won't be able to access the string hello.
I know this is primitive and that in the code above I could simply fix it by putting string hello inside the otherMethod (etc.) but this was just an example.
If I had to have string hello outside of the methods and use the otherMethod inside the Main method, how could I achieve it? Is it possible or am I doing it completely wrong?