<Div align = "left"> <pre class = "cpp" name = "code"> when I went to compile principles in the morning, I heard about the C language pointer, some questions, so I went back to the dormitory for lab verification.
<P> when a function parameter is a pointer, when this function is called, does the form parameter of this function obtain the pointer itself or a copy of it? The following code: </p> <p> # include "stdio. h"
Void change1 (int * d)
{
Printf ("address_d = % d * d = % d \ n", & d, d, * d );
Int s = 4;
D = & s;
Printf ("address_d = % d * d = % d \ n", & d, d, * d );
}
Void change2 (int * e)
{
* E = 5;
}
Int main ()
{
Int * p (NULL );
Int * q (NULL );
Int a (1 );
While ()
{
Scanf ("% d", & );
Printf ("address_a = % d a = % d \ n", & a, );
P = &;
Q = p;
Printf ("address_P = % d p = % d * p = % d \ n", & p, p, * p );
Printf ("address_q = % d q = % d * q = % d \ n", & q, q, * q );
Change1 (q );
Printf ("address_q = % d q = % d * q = % d \ n", & q, q, * q );
Change2 (q );
Printf ("address_a = % d a = % d \ n", & a, );
Printf ("address_q = % d q = % d * q = % d \ n", & q, q, * q );
Printf ("address_P = % d p = % d * p = % d \ n", & p, p, * p );
}
}
</P>
Author: wche1990