[360] 看看下面的程序输出什么?

#include <stdio.h>
#include <stdlib.h>

int b[5] = {1, 2, 3, 4, 5};
int main() {
    int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
    printf("%d\n", a[10]);
    printf("%d %d\n", sizeof(a), sizeof(a[0]));
    printf("%d %d\n", sizeof(b), sizeof(b[0]));
    char *s1 = "abcde";
    char s2[5] = "abcd";
    char s3[] = "abcde";
    char s4[10] = "abcde";
    printf("%d %d %d %d\n", sizeof(s1), sizeof(s2), sizeof(s3), sizeof(s4));
    //char s5[5] = "abcde";
    //printf("哈哈%c哈%c哈", s5[4], s5[5]);
    int *p = NULL;
    printf("%d\n", sizeof(p));
    return 0;
}

posted @ 2013-01-30 22:14  小尼人00  阅读(145)  评论(0编辑  收藏  举报