0
Passing an array into a function
void func(int x[], int y) { x[0] = 0; y=0; } int main () { int x [] = {7}, y=8; func (x, y); cout << x[0] << y; } // The output is 08 Why is the output not 78? After all, there is not return statement in the void function. Even so, how come only the y value is NOT returned?
2 Réponses