+ 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

16th Jul 2017, 5:17 AM
Михаил Мацых
Михаил Мацых - avatar
2 Réponses
+ 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
16th Jul 2017, 5:37 AM
Limitless
Limitless - avatar
+ 1
Oh, forgot about this. Thanks so much)
16th Jul 2017, 10:36 AM
Михаил Мацых
Михаил Мацых - avatar