Please enable JavaScript.
Coggle requires JavaScript to display documents.
C pointer things (pointer VS array (:warning:
char pointer VS array of…
C pointer things
pointer VS array
-
-
increment operation can be done on pointer,
BUT THE ARRAY NAME
NOTES
-
-
s in below statements acts the same role
char *s= "hello";
and
char s[] = {'h', 'e', 'l', 'l', 'o'};
-
& (ADDRESS OPERATOR)
NOTES
-
The difference of 2 address
IS THE number of steps,
NOT the decimal value of data type
int x = 1; y = 2;
int *p = &x;
int *q = &y;
printf("%d\n", q - p); // output is 1
:warning:
The DIFFERENCE of 2 address from 2 VOID POINTER is the decimal value of data type, NOT the number of steps
-
-