ChinaUnix.net
相关文章推荐:

cannot be cast to javalangComparable

class plane { ... void *operator new(size_t size); }; void *operator new(size_t size) { .. plane *newplane= static_cast;(::operator new(sizeof(plane)); //为什么不是dynamic_cast? plane *p指向某个plane; return p;//p是plane指针呀,应该返回void *类型呀 }

by eiik123456 - C/C++ - 2004-05-17 17:05:27 阅读(1699) 回复(1)

相关讨论

reinterpret_cast和其他转换有什么不同呢? 看了书半天没理解..汗

by linuxcici - C/C++ - 2008-03-17 17:10:10 阅读(1527) 回复(2)

There is a case that if we use String to save Date value and we need to sort by Date, then we need to cast Strng to Date and then compare them. And depending on different format of the string date like mm/dd/yy, or dd/mm/yy, or dd/mm/yyyy, or mm/dd/yyyy. we need to parse all the different format to the same date. Thanks to the API DateFormat, we can do it very easily Like if we want to pars...

by megazeng - Java文档中心 - 2007-04-07 15:12:29 阅读(995) 回复(0)

各位老师: 请问UNIX下的C++程序中,哪一个运算符起到dynamic_cast作用的?为什么程序中的dynamic_cast会遇到编译错误? 请指教!

by StevenJoo - C/C++ - 2005-04-19 14:57:05 阅读(869) 回复(1)
by Wangwen - DB2 - 2004-06-02 14:57:40 阅读(1227) 回复(0)

刚在网上找了找,找到了这样一篇文章: http://www.vckbase.com/document/viewdoc/?id=1651 主要是这里面列举了这样错误的两种方法: float f = 12.3; float* pf = &f; // 错误,指向的类型是无关的(译注:即指针变量pf是float类型,现在要被转换为int类型) int* pn = static_cast(pf); //错误,编译器知道你应该调用static_cast<> //int i = reinterpret_cast(f); 看到这样两句之后,我更加迷惑了…… 在哪儿有详...

by GodPig - C/C++ - 2009-06-01 00:29:01 阅读(3177) 回复(7)

哪位大大能告知以下代码的含义,(最好能每句给个解释) void func(void *v) { int i = reinterpret_cast(v); ... } void main() { func(reinterpret_cast(5)); typedef void (* PFV)(); PFV pfunc = reinterpret_cast(func); pfunc(); }

by please - C/C++ - 2005-12-21 12:38:01 阅读(9317) 回复(9)

2004年中国BBS社区100强 http://it.icxo.com/100bbs/index.html 本贴是为支援ChinaUnix论坛Mail服务器交流区simonzhan老大!!

by sinboy2002 - Linux论坛 - 2004-10-24 00:04:03 阅读(609) 回复(1)

既然是const对象,就不希望(或者在逻辑上不能)修改它,那么为什么还要有const_cast来破坏这种约束呢?我现在遇到的一个情况是函数内部要利用const参数的空间,而在返回前会把它恢复原状,这样在效率上会有很大的提高。不知道是否还有其它的用处?

by bidongliang - C/C++ - 2009-07-27 21:39:17 阅读(1386) 回复(1)

字符集转换 : CONVERT(xxx USING gb2312) 类型转换和SQL Server一样,就是类型参数有点点不同 : cast(xxx AS 类型) , CONVERT(xxx,类型),类型必须用下列的类型: 可用的类型  二进制,同带binary前缀的效果 : BINARY 字符型,可带参数 : CHAR() 日期 : DATE 时间: TIME 日期时间型 : DATETIME 浮点数 : DECIMAL 整数 : SIGNED 无符号整数 : UNSIGNED ...

by sislcb - MySQL文档中心 - 2008-12-13 15:24:45 阅读(1668) 回复(0)