Passing pointer to local variable to function: is it safe?

后端 未结 6 2131
余生分开走
余生分开走 2020-12-15 20:15

For example:

void func1(){
    int i = 123;
    func2(&i);
}
void func2(int *a){
    *a = 456;
}

When func1 calling

6条回答
提交回复
热议问题