posts - 2,  comments - 3,  trackbacks - 0

1.
#include<cstdio>

int main(int argc, char* argv[], char* env[])
{
   int t = 1;
   /** 32位寄存器 左右移32位 指令无效*/
   printf("%d\n", t<<32);
   printf("%d\n", t>>32);
 
   /** 注意指针类型sizeof = 4, 结构体数组指针更容易忽略*/
   char* p1 = "123";
   char  p2[] = "12345";
   char  p3[10] = "1234567";
 
   printf("sizeof(p1) = %d\n", sizeof(p1));
   printf("sizeof(p2) = %d\n", sizeof(p2));
   printf("sizeof(p3) = %d\n", sizeof(p3));
 
   getchar();
   return 0;
}

posted on 2011-12-01 10:24 Lshain 阅读(95) 评论(0)  编辑 收藏 引用 所属分类:
<2024年9月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

常用链接

留言簿

文章分类(46)

文章档案(33)

ACM

Algorithm Link

BLOG

Format analysis

Forum

Math

mirror

OpenGL

Protocol Analyzer

Recent Contests

Search

WIN32 Programming

最新随笔

搜索

  •  

最新评论

阅读排行榜

评论排行榜