271 views
2 votes
2 votes
#include <stdio.h>
void fun(int* p) {
    *p = 10;
}
void fun1(int *p) {
    int a = 10;
    p = &a;
}
int main() {
    int x = 30;
    int *p = &x;
    fun1(p);
    printf("%d\n",*p); // output = 30
    fun(p);
    printf("%d",*p); // output = 10
}

Please log in or register to answer this question.

Related questions

1 votes
1 votes
1 answer
3