阅读下列程序,写出运行结果:
#include <iostream>
using namespace std;
void test1( int *a1 )
{
a1 = new int( 5 );
cout << "*a1 = " << *a1 << endl;
}
void test2(int * & a2)
{
a2 = new int( 5 );
cout << "*a2 = " << *a2 << endl;
}
int main()
{
int *p = new int( 1 );
test1( p );
cout << "test1: *p1 = " << *p << endl;
test2( p );
cout << "test2: *p2 = " << *p << endl;
}

*a1= 5
test1: *p1= 1
*a2= 5
test2: *p2= 5