C语言--指针数组大小

时间:2014-07-01 20:03:42   收藏:0   阅读:422
#include <stdio.h>
#include <string.h>
int main(void)
{

char *str[3]={
"Hello,thisisasample!",
"Hi,goodmorning.",
"Helloworld"
};

char s[80];

printf("size  %d\n",sizeof(char [3])); //
printf("size  %d\n",sizeof(str)); // 3X4=12

printf("size  %d\n",sizeof(*str)); //   sizeof((char *)str)

bubuko.com,布布扣

 

C语言--指针数组大小,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!