人较笨且记性不好,故记录在此.折叠代码打不开请F5.本博中很多是转载收录其他网友的文章(原文地址请见博文末尾),所有权为原作者所有!!!
此博客已不再更新和维护,欢迎关注我的github新博客

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::

2011年8月31日

摘要: 1 #include <stdio.h> 2 3 int&foo(int a) 4 { 5 static int t; 6 t = a; 7 return t; 8 } 9 10 void main(void)11 {12 if (foo(1) == foo(2))13 {14 printf("right!\n");15 }16 return;17 } 最后结果为:right! 下面为执行过程中的汇编代码:16: if (foo(1) == foo(2))00401078 push 10040107A c... 阅读全文
posted @ 2011-08-31 21:48 子坞 阅读(282) 评论(0) 推荐(0) 编辑

摘要: 1 #include <stdio.h> 2 3 struct MyStruct 4 { 5 int a; 6 MyStruct(); 7 } 8 9 MyStruct::MyStruct()10 {11 a =10;12 }13 14 void main(void)15 {16 MyStruct test;17 printf("%d\n", test.a);18 } 最后结果是:10 另外,将上述代码修改如下: 1 #include <stdio.h> 2 3 struct MyStruct 4 { 5 int a:4; // 注意!!! 6 M. 阅读全文
posted @ 2011-08-31 21:24 子坞 阅读(1009) 评论(2) 推荐(0) 编辑