小编Tap*_*ami的帖子

我的程序返回 4 而不是预期值 40

#include <stdio.h>
    
int value(int *a);
    
int main(){
    int num = 4;
    value(&num);
    printf("value of number is = %d", num);
    return 0;
}

int value(int *a){
    int c = (*a)*10;
    return c;
}
Run Code Online (Sandbox Code Playgroud)

在这段代码中,我在函数中传递了地址,但它没有改变,为什么?

c

-5
推荐指数
1
解决办法
110
查看次数

标签 统计

c ×1