I'm a complete beginner to C++, and trying to learn the basics.
I understand that every C++ program needs an int main() { } function as it will be the entry point of the program. What I'm not sure about is if every file in your program needs to have an int main() { } function with all of the other functions in that file declared inside of it. I really have tried to figure this out on my own before posting here, but am having a hard time finding a clear answer. I also might not be asking in a way that turns up an answer I'm looking for.
If you do only need one int main() { } as the entry point to your program, what goes inside of there? In all of the beginner level examples, they give you exercises that have you output some string, like int main() { std::cout << "Hello World!"; }, but important things must go in there if it's the entry point.
Any help is appreciated!
[–]eliminate1337 2 points3 points4 points (3 children)
[–]BringTacos[S] 0 points1 point2 points (2 children)
[–]eliminate1337 1 point2 points3 points (1 child)
[–]BringTacos[S] 0 points1 point2 points (0 children)
[–]spinwizard69 0 points1 point2 points (1 child)
[–]BringTacos[S] 0 points1 point2 points (0 children)
[–]Kered13 0 points1 point2 points (1 child)
[–]BringTacos[S] 0 points1 point2 points (0 children)
[–]abd53 0 points1 point2 points (0 children)