Vote count:
0
I'm a beginning C++ coding, currently working on teaching myself through various information sites and places like this. I have a question that I've searched for; it seems easy but the answers I've found are very complicated.
All of the examples I've seen declare functions first, then write int main(); my understanding is that this is considered top-down. I'm trying to get a definitive answer as to why this is done, instead of int main() and then functions. From the best I can gather, this is simply a programmers choice in terms of aesthetics of the code, and that either way the program will execute in the same way. The benefit of top-down is being able to skip scrolling through the int main() code to add/change a function.
Is my understanding correct, or is there a functional benefit to coding one way vs the other?
Top-Down vs Bottom-Up in C++
Aucun commentaire:
Enregistrer un commentaire