设为首页 加入收藏

TOP

关于差分约束最长路和最短路(一)
2013-11-20 14:19:01 来源: 作者: 【 】 浏览:1017
Tags:关于 差分 约束 长路 短路

  本文尽可能多的测试了在win32平台下用sizeof()求各种类型变量字节数的结果,而且会不断更新。很有参考价值哦!

  sizeof(char)=1

  sizeof(short)=2

  sizeof(int)=4

  sizeof(long)=4

  sizeof(float)=4

  sizeof(double)=8

  sizeof(long double)=8

  sizeof(unsigned char)=1

  sizeof(unsigned short)=2

  sizeof(unsigned int)=4

  sizeof(unsigned long)=4

  sizeof(unsigned float)=4

  sizeof(unsigned double)=4

  sizeof(unsigned long double)=8

  char a[] = {'a','b','c','d','e'};//sizeof(a)=5

  char b[] = "abcde";//sizeof(b)=6

  char c[] = {{'a','b','c'},{'d','e','f'},{'g','h','i'},{'j','k','l'}};

  //sizeof(c)=12

  //sizeof(c[0])=3

  //sizeof(c[0][0])=1

  char d[] = {"abcc","deff","ghii","jkll"};

  //sizeof(d)=20

  //sizeof(d[0])=5

  //sizeof(d[0][0])=1

  char *p = 0;//sizeof(p)=4

  char *q = (char *)malloc(5);//sizeof(q)=4

  char *r = "abcde";//sizeof(r)=4

  char (*f)(void) = NULL;//sizeof(f)=4

  char *s1 = {"aa","bb","cc"};

  //sizeof(s1)=12

  //sizeof(s1[0])=4

  //sizeof(*s1[0])=1

  char *s2 = {{"aa","bb","cc"},{"aa","bb","cc"},{"aa","bb","cc"}};

  //sizeof(s2)=36

  //sizeof(s2[0])=12

  //sizeof(*s2[0])=4

  char h = {{1,2,3},{4,5,6},{7,8,9}};

  char (*ph) = h;

  //sizeof(ph)=4

  //sizeof(*ph)=3

  //sizeof(ph[0])=3

  //sizeof(*ph[0])=1

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 1/11/11
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇在C语言下用google protobuf 下一篇求二叉树两结点最小公共祖先

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: