-
Notifications
You must be signed in to change notification settings - Fork 162
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
[Cpp] Challenge 2 (Unreviewed) #408
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting the size of the array from the user is prone to error and could be dangerous in C, idk about C++. IMO it should determine the size of the array on its own
@jacktraf Thanks for the comment :) I'm interested in this. Why is dangerous in C? I don't know C very well so I would like to understand more about it. |
Reading/writing past the end of a buffer/array in c/c++ is a big no no. Its classified as undefined behavior / buffer overflow (in the case of writing). See also https://en.m.wikipedia.org/wiki/Buffer_overflow for possible security risks |
Also, never trust user input |
@jacktraf thanks for the answer :) |
No description provided.