What is the need to declare and define functions separately? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

What is the need to declare and define functions separately?

Besides making the code look more organized, is there any real benefit in declaring the function early and defining it later?

20th Dec 2017, 5:17 PM
Advitiay Anand
Advitiay Anand - avatar
2 Réponses
+ 2
you can declare and define function simultaneously but if you declare first then define it later it make code more organised and readable for professional as well more easy to understand for a newbie
20th Dec 2017, 5:55 PM
Hack Erer
Hack Erer - avatar
+ 1
Right. So I can just define every function before main() then? Thanks.
20th Dec 2017, 6:34 PM
Advitiay Anand
Advitiay Anand - avatar