+ 1
Code isn't working 'cause of reference, but i can't understand why. Help plz
I'm learning c#, and it's my test program. Compiler don't want to my program in case of reference in the Main method (line 30). If you can help me, I would be greatful) https://code.sololearn.com/c1ee8ptQaR05/?ref=app
2 ответов
+ 2
Since this is your "Main function" it is set to static:
static void Main(string [] args) ....
Because it's static you can only use other static methods unless you create an object or do an object reference. (That's when you use other classes to help you in this program)
So you'll be to make your functions in your main class all static functions before the program can correctly work
+ 1
Oh, forgot about this.
Thanks so much)