#include <iostream>
using namespace std;

int * A;
int * B;

void bad(int *a, int *b)
{
	a = new int(1);
	b = new int(2);
}
void good(int *a, int *b)
{
	*a = 3;
	*b = 4;
}
void strange(int **a, int **b)
{
	*a = new int(5);
	*b = new int(6);
}
int main() 
{
	A = new int(0);
	B = new int(0);
	cout << "before : " << *A << "," << *B << endl;
	bad(A,B);
	cout << "after bad : " << *A << "," << *B << endl;
	good(A,B);
	cout << "after good : " << *A << "," << *B << endl;
	strange(&A, &B);
	cout << "after strange : " << *A << "," << *B << endl;
	
	return 0;
}