对比如下两个函数的差异
void exchange(int *pointer1, int *pointer2){
int *temp;
temp=pointer1; pointer1=pointer2; pointer2=temp;
}
———————————————————-
void exchange(int *pointer1, int *pointer2){
int *temp;
temp=pointer1; pointer1=pointer2; pointer2=temp;
}
请问这2个函数有什么差异啊?
>> 本文固定链接: http://www.vcgood.com/archives/2470
指针的用法有点问题,不能得到预期的效果;
void exchange(int *pointer1, int *pointer2){
int temp;
temp=*pointer1; *pointer1=*pointer2; *pointer2=temp;< ?:NAMESPACE PREFIX = O />
}