+ 2
In C++, does everything have to be on the main function?
8 Answers
+ 3
No, you can create a void function out of the main(). For example this:
https://code.sololearn.com/cQu8biG7lFxp/?ref=app
+ 3
Thanks again :D
+ 2
Sauron24 when we want to declare a function without returning value, we use void ,for more informations see this :
https://www.sololearn.com/learn/CPlusPlus/1635/?ref=app
and this :
https://www.sololearn.com/learn/CPlusPlus/1636/?ref=app
+ 2
Any function can be made recursive, not just main().
+ 1
Thanks.
And what does a void function do?
+ 1
You can declare variables,function,externs outside main().
+ 1
Nope, you can declare variables, functions, macros and ... out of the main function.
+ 1
time - tick tock