2013年1月28日 星期一

[C Language] Pointers


[C Language] Pointers



By reference is a good article which introduce about point.



Pointer's identifier with an asterisk (*)



Example :



int happy;  <--- This variable just can assign one variable.



int firstvalue;
int mypointer;

mypointer = firstvalue; <--- I just can assign integer





int *happy; <--- This variable can assign integer and address

 



int firstvalue;
int * mypointer;

mypointer = &firstvalue; <--- No asterisk(*), I can assign address
*mypointer = 10;
<--- With asterisk(*), I can assign Integer


 



Reference :



0 意見:

張貼留言