[ create a new paste ] login | about

Link: http://codepad.org/r9ud4Qsm    [ raw code | output | fork ]

C++, pasted on Mar 4:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>

void f1(int **p);
void f2(int **p);

int main(){
int *p;
f1(&p);
std::cout<<p<<std::endl; //Should output a 0.
return 0;
}
void f1(int **p){
f2(p);
}
void f2(int **p){
*p = NULL;
}


Output:
1
0


Create a new paste based on this one


Comments: