Cant use void in c4droid android app.

Hi, I am using c4droid android app to compile.
But, when I use void main() it shows me an error
"main() must return int"
Please help me out.
As Android rus on linux kernal I have asked this question in this forum.
Hi,

Instead of using void main() use int main() and in the end of your code add return 0; statement... void main() just works with old compilers and not the new ones
void main() is not standard and is thus not supported by default by the standard.

For that reason you should never use void main() but rather always use int main() since that is the standard.

@programmer007 void main does work with visual studio 2015.

If you want more info, here is a link to Stroustrup's page which talks about why void main() is not acceptable. http://www.stroustrup.com/bs_faq2.html#void-main
Topic archived. No new replies allowed.