I am learning C programming and I have a simple question about the indicator ...
I used it to play with the following code:
#include & lt; Stdio.h & gt; Int main (int argc, const char * argv []) {int * c; Printf ("% x \ n", c); Return 0; } When I print the value of C, I get back to 0. However, when I print and c (i.e. printf ("& amp; x \ n", & amp; c) I get the address in memory ...
("% X \ n", c)?
--- edit ---
#include & lt; stdio.h & gt; #include & lt; stdlib.h & gt; int main (int argc, const char * printf ("% s", a); printf ("% s", a );}/ Pre>The question is, why printf ("% s", a) returns a string instead of the address that is stored in
? Pointer and then string to pr
Your current program is not correct. You define the variable and not before the first value Set value. The initial value is not guaranteed for c , but you are lucky and it is equivalent to 0 . This means that c Do not say anywhere when you print & amp; c then you print the address of the variable c so that in fact both versions print addresses
Comments
Post a Comment