Why we put main() method always inside the class in C# while in c++ it always placed outside of the class.
Why we put main() method always inside the class in C# while in c++
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For historical reasons. C++ evolved from C, which had a global
main()function. C# is much younger and was designed from scratch. One of the design features of C# is the absence of global functions, so themainfunction has to belong to a class.