Files
codeql/cpp/ql/src/Critical/LargeParameter.cpp
2018-11-07 11:32:17 -08:00

14 lines
311 B
C++

typedef struct Names {
char first[100];
char last[100];
} Names;
int doFoo(Names n) { //wrong: n is passed by value (meaning the entire structure
//is copied onto the stack, instead of just a pointer)
...
}
int doBar(Names &n) { //better, only a reference is passed
...
}