the basic of my C++ is so weakness....because i have not go to class about C++ in my university...
wo lost something when i get something....
get to business , this question puzzled me so long time....
today let's analyse it...
the first , 指针...
int *pointer;
int test=100;
pointer=&test;
the value of pointer is the address of test.
and *pointer=test;
and ....the other
int test=100;
int *pointer=test; // this say test is int type value...pointer is pointer type value
and this is equal to int *pointer=&test;
and also equal to :
int *pointer;
pointer=&test;
if you change the value of test , the value of pointer not change...
this is 指针...
the second...指针数组
int test[20];
int *pointer=test; or
int *pointer=&test[20]; or
int *pointer; pointer=test; or
int *pointer; pointer=&test[20];
the value of pointer is the address of a[0]...
then....pay attention to this...
test[i]=*(test+i)=pointer[i]=*(pointer+i);
&test[i]=test+i=&pointer[i]=pointer+i;
and sizeof(test)!=sizeof(*test)...
tomorrow go on...