and side note: never ever ever ever use goto or system. EVER |
This is primarily to increase readability, nothing else.
If you're gonna have others read your code, you should avoid using
goto
.
Though in some cases, even when others gonna read the code,
goto
might be the only way.
Anyway, it's good practice to try to avoid it whenever it is the first thing that pops into mind, makes your head come up with other solutions.
When it comes to
system(char*)
, i'm no expert, but unless you got another more efficient code to deal with OS specific tasks, i see no reason why not.
Yeah you shouldn't have everything inside main. |
This would also be to increase readability.
Though, it would provide for faster execution to keep the code in main(not a problem in your case).