main()
-
what happen if we use inline keyword before main(). is it allowed? if yes how what will be behavior of programm
-
what happen if we use inline keyword before main(). is it allowed? if yes how what will be behavior of programm
inline
doesn't enforce the function to be actually inlined. it's up to the compiler to decide if the function is simple enough. moreover, the main goel in inlining functions is for earning some call time when the function is called multiple times ; main is called once AVAIK !
Don't know where to start ?
Refer the Forums Guidelines and ask a friend -
what happen if we use inline keyword before main(). is it allowed? if yes how what will be behavior of programm
Using the keyword
inline
before a function does not necasserily mean it will be inline, it is more like a request to the compiler. In the case ofmain()
the request would be declined. -
inline
doesn't enforce the function to be actually inlined. it's up to the compiler to decide if the function is simple enough. moreover, the main goel in inlining functions is for earning some call time when the function is called multiple times ; main is called once AVAIK !
Don't know where to start ?
Refer the Forums Guidelines and ask a friendtoxcct wrote:
main is called once AVAIK !
Unless it is called recursively, which I've seen people do.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
toxcct wrote:
main is called once AVAIK !
Unless it is called recursively, which I've seen people do.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb