What does the main() function do?

Hello! I’ve just started taking the unreal C++ courses.

Ben has challenged me to ask the community what the Main() function does…

I think it’s the base of your code. The beginning structure. In this you’ll be able to put in the foundation of the game you’re going to code in C++.

Hopefully I’m somewhat right, I actually don’t know it at all but this is my guess.
If someone sees this would you care to explain to me what it means? :slightly_smiling_face:

Cheers!

2 Likes

Yes, you are correct about your guess. Main() is just function that runs when you start the program

1 Like

In C based (C, C++, C#) languages, main() is the first function that is executed in your application.

So, any code inside main is executed when your C++ application is executed.

2 Likes

Thank you very much for the response!

Thanks!