[ create a new paste ] login | about

Link: http://codepad.org/NpySSNxu    [ raw code | output | fork ]

C, pasted on Jan 28:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdlib.h>
#include <stdio.h>

    int main ( void )
    {
        char some_array[100];
        printf("Address in main: %p\n", (void*) &some_array[0]);
        printf("value of some_array: %p\n", (void*) some_array);
        pass_arr(some_array);
        return 0;
    }
    void pass_arr(char *arr)
    {
        printf("Address of pointer VAR: %p\n", (void *) &arr);
        printf("Pointer address: %p\n", (void *) arr);
        printf("points to: %p\n", (void *) &(*arr));
    }


Output:
1
2
3
4
5
Address in main: 0xbf731998
value of some_array: 0xbf731998
Address of pointer VAR: 0xbf731964
Pointer address: 0xbf731998
points to: 0xbf731998


Create a new paste based on this one


Comments: