I'm not sure if I understand this properly and can't find it anywhere.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
void cat (int a, int b, int& c)
int main ()
{
int w = 1;
int x = 2;
int y = 3;
int z = 4;
cat (w, x, y);
}
void cat(int a, int b, int& c)
{
a += 2;
c= a+b;
}
This is called pass-by-reference and it is the same as if you had done this:
1 2 3 4 5 6 7 8 9 10 11
void cat (int a, int b, int* c)
int main () {
int w = 1, x = 2, y = 3, z = 4;
cat (w, x, &y);
return 0;
}
void cat(int a, int b, int* c) {
a += 2;
*c = a + b;
}