#include "stdafx.h" #include <iostream> using namespace std; void swap(int ***a, int ***b) { int *number=0; int **temp=&number; *temp=**a; **a=**b; **b=*temp; } int main() { int a=50, b=100; int *pa_1=&a, *pb_1=&b; int **pa_2=&pa_1, **pb_2=&pb_1; swap(&pa_2,&pb_2); cout<<**pa_2<<" "<<**pb_2<<endl; // 100 50 cout<<a<<" "<<b<<endl; // 50 100 system("pause"); return 0; }
569