[ create a new paste ] login | about

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

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

void print_p(char* a)
{
    printf("Size of Pointer: %d\n", sizeof(a));
}

void print_a(void)
{
    char a[256];
    printf("Size of Array: %d\n", sizeof(a));
}

int main(void) {
    char a[] = "Hello, World!\n";
    print_p(a);
    print_a();
    return EXIT_SUCCESS;
}


Output:
1
2
Size of Pointer: 4
Size of Array: 256


Create a new paste based on this one


Comments: