C指针数组

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

int main(void)
{

    char const *str[] = {
        "this is a pointer array test.",
        "welcome to here!",
        "hello,hello,hehe."
    };

    char const **temp;
    int size = sizeof(str)/sizeof(str[0]);
    printf("%ld\n", sizeof(str));
    printf("%ld\n", sizeof(str[0]));

    for(temp=str; temp<str+size; temp++)
    {
        printf("%s\n", *temp);
    }

    return EXIT_SUCCESS;
}

 

posted @ 2014-08-26 06:54  yshy  阅读(160)  评论(0编辑  收藏  举报