还有一点:请注意时机与效率的问题。
=×&D o I p R e E n C g T l X&×=
这是楼上的验证的程序。指针的分配就是不连接的。如果是边接的那么结果就不会是0了。
#include <iostream>
using namespace std;
void f(int ** p)
{
cout<<"*p = "<<(long)*p<<endl;
cout <<"p=" <<(long)p<<endl;
*p++;
cout <<"p=" <<(long)p<<endl;
cout<<"*p = "<<(long)*p<<endl;//?里?什??出的是?49,而上面?出的是地址??
}
int main()
{
int i =49;
double j = 50;
int * ip = &i;
cout<<"ip = "<<(long)ip<<endl;
f(&ip);
return 0;
}