After the pointer is initialized, it can change the object it points to, but it must be initialized when referring to the definition. After initialization, it is not allowed to rebind the object.
3. So access the reference access object directly. Pointer access to an object is indirect access.
4。 If pa is a pointer, then *pa is a reference.
But it is very similar when used as a formal parameter, the difference is that the pointer is copied, and the reference is not copied. The process is as follows:
# include & ltstdio.h & gt
Invalid? pt(int? *? pta,int? *? ptb)
{
int? * ptc
ptc = ptapta = ptbptb = ptc
}
Invalid? ref(int? & ampra,int? & Regular budget)
{
int? RC;
rc = rara = rbrb = rc
}
Invalid? Master ()
{
int? a = 3; int? b = 4;
int? * pa = & ampa; int? * pb = & ampb;
pt(pa,Pb);
Printf ("Zhizhen:? a=%d,b=%d\n ",a,b);
ref(a,b);
Printf ("Yin Yong? a=%d,b=%d\n ",a,b);
}
The output results are as follows: