mirror of
https://github.com/github/codeql.git
synced 2026-07-21 11:18:20 +02:00
14 lines
311 B
C++
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
|
|
...
|
|
}
|