摘要: static_cast is the first cast you should attempt to use. It does things like implicit conversions between types (such as int to float, or pointer to void*), and it can also call explicit conversio... 阅读全文
posted @ 2012-03-08 22:09 os66 阅读(386) 评论(0) 推荐(0)
摘要: 转【C++专题】static_cast, dynamic_cast, const_cast探讨 2012-3-8 21:27:45 这是我看到的:关于 dynamic_cast static_cast的罪有说服力 ... 阅读全文
posted @ 2012-03-08 21:36 os66 阅读(352) 评论(0) 推荐(0)
摘要: 1) auto auto变量就是局部变量,一般不用加auto。自动的意思是自动作用域,自动离开作用域。 2) register register变量是提示编译器尽量放在寄存器中保存,以增加 速度。 只能定义局部的register变量,或者作为函数参数,没有全局或静态的。 在C语言中,是不能对register变量取地址的,因为... 阅读全文
posted @ 2012-03-08 13:02 os66 阅读(294) 评论(0) 推荐(0)
摘要: 关于const与volatile笔试题目的分析 小计录:今天转么对 以下代码上机实验: const_cast前后的内存地址是一样,只不过 &a是常指针,而转换后的是一般指针。, 关键点是: 编译器看到const ,在编译时就把所有引用const 变量的地方替换了。 所以第一次使用const的地方才分配内存!!(只分配一次内存的还有引用) 2012年3月8日12:49:53 by ... 阅读全文
posted @ 2012-03-08 12:51 os66 阅读(388) 评论(0) 推荐(0)