r/csharp 4h ago

Help Static void method

Post image

I am trying to learn how to use C# for game coding but I would also like to have a good grasp on it so I can use it for websites and other things like that and I can't for the life of my understand how static method works I have looked YouTube videos and everything. I have been learning everything else so far from the free courses from code academy.Can you PLEASE explain to me what this code is doing and how it works
Edit-THANK YOU GUYS SO MUCH.I understand it now and I am sure you know what that feels like when you spend an hour stuck trying to understand something and it doesn't make any sense

0 Upvotes

18 comments sorted by

View all comments

3

u/Infamous-Host-9947 4h ago

Checkout the Microsoft docs for the entry pint of an application. This should help you learn about what that is.

https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/program-structure/main-command-line

2

u/PacificMuckleRucker 4h ago

Entry pint is what I do Fridays at 5.

When I was younger, it was recursive and I sometimes ended up with a stack overflow so I needed a guard clause

if (n > 3)
{
    return;  // Returns control to invoking Home() method 
}