#GESP3617. [GESP]L4-202512-Q3617-S

[GESP]L4-202512-Q3617-S

执行完下面的代码后,a、b 和 c 的值分别是( )。

void byValue(int x) { x = 100; }
void byRef(int& x) { x = 200; }
void byPointer(int* x) { *x = 300; }

int main() {
    int a = 1, b = 2, c = 3;
    byValue(a);
    byRef(b);
    byPointer(&c);
    return 0;
}

{{ select(1) }}

  • 100 200 300100\ 200\ 300
  • 1 2 31\ 2\ 3
  • 1 200 3001\ 200\ 300
  • 1 2 3001\ 2\ 300