Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isn't void main() mot allowed in C++ ?? #186

Closed
vishvanathan-k opened this issue Jul 9, 2021 · 2 comments
Closed

Isn't void main() mot allowed in C++ ?? #186

vishvanathan-k opened this issue Jul 9, 2021 · 2 comments

Comments

@vishvanathan-k
Copy link

vishvanathan-k commented Jul 9, 2021

I am C++ learner, i don't know about IoT. Just out of curiosity, Isn't void main() considered invalid from C++ 98.Or is it only for normal C++ and not the C++ IoT devices use ???
Edit: I am talking about IoT generally, bcoz I have come across some using void main() , Because its a IoT repo. Perphaps you can guide me. Thanks

@jimbobbennett
Copy link
Contributor

void main() is definitely not standard C++. If your compiler supports it then you still shouldn't use it as it could have undefined behavior.

For IoT a lot of the time this a moot point as the frameworks handle this for you. For example, with Arduino, your main function (as in the first part of your code that is called) is setup, called by the Arduino framework.

@vishvanathan-k
Copy link
Author

ohh! Thanks @jimbobbennett for clarifying my doubt 👍 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants