[Cpp] Challenge 2 (Unreviewed)#408
[Cpp] Challenge 2 (Unreviewed)#408rbrtdambrosio wants to merge 5 commits intoYearOfProgramming:masterfrom
Conversation
jacktraf
left a comment
There was a problem hiding this comment.
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.