mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
P.5 example read int array size mismatch (#1161)
Expand comment to clarify problem.
This commit is contained in:
parent
b487f9790a
commit
9c4d4247b1
|
@ -697,7 +697,7 @@ Or better still just use the type system and replace `Int` with `int32_t`.
|
|||
void read(int* p, int n); // read max n integers into *p
|
||||
|
||||
int a[100];
|
||||
read(a, 1000); // bad
|
||||
read(a, 1000); // bad, off the end
|
||||
|
||||
better
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user