
class plane
{
...
void *operator new(size_t size);
};
void *operator new(size_t size)
{
..
plane *newplane=
static_cast
by eiik123456 - C/C++ - 2004-05-17 17:05:27 阅读(1699) 回复(1)
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...
刚在网上找了找,找到了这样一篇文章: http://www.vckbase.com/document/viewdoc/?id=1651
主要是这里面列举了这样错误的两种方法:
float f = 12.3;
float* pf = &f;
// 错误,指向的类型是无关的(译注:即指针变量pf是float类型,现在要被转换为int类型)
int* pn = static_cast
哪位大大能告知以下代码的含义,(最好能每句给个解释)
void func(void *v) {
int i = reinterpret_cast
2004年中国BBS社区100强 http://it.icxo.com/100bbs/index.html 本贴是为支援ChinaUnix论坛Mail服务器交流区simonzhan老大!!
既然是const对象,就不希望(或者在逻辑上不能)修改它,那么为什么还要有const_cast来破坏这种约束呢?我现在遇到的一个情况是函数内部要利用const参数的空间,而在返回前会把它恢复原状,这样在效率上会有很大的提高。不知道是否还有其它的用处?
字符集转换 : CONVERT(xxx USING gb2312) 类型转换和SQL Server一样,就是类型参数有点点不同 : cast(xxx AS 类型) , CONVERT(xxx,类型),类型必须用下列的类型: 可用的类型 二进制,同带binary前缀的效果 : BINARY 字符型,可带参数 : CHAR() 日期 : DATE 时间: TIME 日期时间型 : DATETIME 浮点数 : DECIMAL 整数 : SIGNED 无符号整数 : UNSIGNED ...