Pointers
This commit is contained in:
parent
4668601cac
commit
51415ec6a1
1 changed files with 10 additions and 0 deletions
10
main.c
10
main.c
|
|
@ -76,6 +76,16 @@ int main() {
|
|||
int arr[] = {21, 67, 69, 420};
|
||||
printf("arr[0]=%d\narr[1]=%d\narr[2]=%d\narr[3]=%d", arr[0], arr[1], arr[2], arr[3]);
|
||||
|
||||
// POINTER
|
||||
printf("\n\nPOINTER BELOW:\n"); // DIVIDER
|
||||
int victim=7;
|
||||
int *victim_pointer=&victim;
|
||||
printf("pointer of int victim is: %p\n", victim_pointer);
|
||||
int derefrencing_operator=*victim_pointer;
|
||||
printf("derefrencing operator of *victim_pointer is: %d\n", derefrencing_operator);
|
||||
int **double_ptr = &victim_pointer;
|
||||
printf("double pointer of the &victim_pointer is: %p", double_ptr);
|
||||
|
||||
// END
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue