thecodewall wrote: |
---|
@kyon some compiler or ide you are using for me I use code blocks will not give you warning if you dont put int in main. Main is a special function, you can put int use void or even without it. You can even not use the return statement.
There are no non-standard code! It up to programmer how he program it as long as its correct, useful, safe and secure and maintainable and approve by user.
http://thecodewall.blogspot.com |
You are right. Compilers and IDE's won't support it by default, install the library I gave a link to and it will work.
EDIT:
As a side note, the code I posted was mainly - like all posts after the OP doesn't react - to troll in a light-sense.
Light, because with the library added, the program actually does what he wants.
Trolling because it's using simulated recursive function calls by following a functor-vector depending on a wrap around number. ... instead of a do-while loop.
RE-EDIT:
Another note, you mixed up terms, obviously:
There are no non-standard code! It up to programmer how he program it as long as its correct, |
The standard
defines what is correct. You are talking about good practices (as chathura already pointed out).
RE-RE-EDIT:
This post is getting really long. But I had to re-edit it AGAIN to show you another flaw in your logic.
Main is a special function, you can put int use void or even without it. You can even not use the return statement. |
Int is standard; all compilers support it. Void is non-standard, only some compilers support it, but really shouldn't. Return is never needed.
What I'm trying to point out is that you SHOULD return an int, the OS you are running simply wants return-codes. If you don't tell the OS that your program has struck upon an error or if it ran successfully, things can get messy.