-
Notifications
You must be signed in to change notification settings - Fork 96
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
Improve code in example/ #97
Conversation
Why is is the following better? |
Use defined constants to indicate success and failure.
It is there for educational purposes
3d5af2d
to
1c067b5
Compare
I am glad you ask this question!
Two sources to support my claim with different arguments: |
ok, declaring variable inside the loop was considered bad in the old style. But now as long as the compiler knows not to repeatedly generate new variables, it would be fine. |
Fix warnings.
Make variables more local, e.g., just inside for loops.
Add missing headers.
Add return statements for
int main(..)