Professional Documents
Culture Documents
7 - Pointers PDF
7 - Pointers PDF
) ( pointers
( ).
* ) ( asterisk .
x int p ( int
) . .
. .
& ( x
) x x .
) 0111 ( x . p
x x
.
x p * .
* :
)0 .
)2
.
x & . p
%p .
.. ...
p 0110 .
:
)0 ) . ( Dynamic memory allocation
)2
.
)3 .
.
Stack / Heap
stack . heap
. RAM .
Stack Heap
stack heap
.
stack . heap
.
:
)0 " " .
)2 stack
stack overflow crash
.
)3 stack
. heap
" " .
& .
.
= . 1000
.
0110 0111
.
Structure
char int ""
.. ... ..
. structures
human .
.
.
.
strcpy name
assignment . String
human
.
mahmoud .
( human ) human
( * ) .
pstruct , human
( human ) mahmoud
.
pstruct mahmoud .
*
* .
calloc malloc stdlib.h
include . malloc
malloc
built-in int .. char
user-defined mahmoud human .
sizeof .
malloc * void
casting .
int .
int malloc
int 4 casting
25 * .
human .
>. -
calloc
calloc
.
calloc .
calloc malloc .
] pnum[i
.
( ) . calloc
calloc
.
employee ( )
.
pemp . employee
employee . n