ポインタの参照渡し
#include<iostream> #include<string> using namespace std; // 引数のポインタを0(NULL)にする void Ref(int* (&a)) { a = 0; } // 引数のポインタを0(NULL)にする void Ptr(int** a) { *a = 0; } int main() { int num = 5; int *i = # cout << "i=" << i << " -> "; Ref(i); // Ptr(&i);でもOK cout << i << endl; return 0; }