ChinaUnix.net
相关文章推荐:

c89 const void

#define DE_const(konst, var) \ do { \ union { const void *k; void *v; } _u; \ _u.k = konst; \ var = _u.v; \ } while (0)

by rain_fish - C/C++ - 2010-08-17 17:00:29 阅读(6340) 回复(20)

相关讨论

本帖最后由 风情123 于 2011-10-24 15:18 编辑 请教下大家: void validate() const {} 与 void const validate() {} 有区别么? 以前从来没有见过后者的写法的,今天看代码的时候第一次看到,是不是写错了的啊? 请大家多多指点,多谢了~

by 风情123 - C/C++ - 2011-10-24 15:18:24 阅读(3869) 回复(13)

class A { public: virtual void sleep() const = 0; } 我原来的理解是:这就是用“=0”表示函数体是空的。 但是又发现VC支持: class A { public: virtual void sleep() const = 0{ int i}; } 似乎我原来的理解不对。 这个=0究竟准确含义是什么呢?

by yuonunix - C/C++ - 2007-10-23 19:13:19 阅读(3690) 回复(1)

void CALL sort(int n, const double data[], int index[]) 这个CALL有什么意义

by bollwarm - C/C++ - 2006-02-20 16:37:23 阅读(1605) 回复(3)

class A{ public: void copy(const A& a); private: int t; }; void A::copy(const A& a){ t=a.t;} 这里A::copy为什么能能访问a对象的私有成员t? 请大侠解答!先谢了! :>

by terryfjh - C/C++ - 2004-07-05 09:56:14 阅读(2312) 回复(11)

定义了void fun(const int i)与 void fun(int i) 编译出错 提示:fun(const int )已经存在。

by kewenliang - C/C++ - 2008-06-29 20:20:01 阅读(3139) 回复(7)

voidvoid指针 void的含义 void即“无类型”,void *则为“无类型指针”,可以指向任何数据类型。 void指针使用规范 ①void指针可以指向任意类型的数据,亦即可用任意数据类型的指针对void指针赋值。例如: int *pint; void *pvoid; pvoid = pint; /* 不过不能 pint = pvoid; */ 如果要将pvoid赋给其他类型指针,则需要强制类型转换如:pint = (int *)pvoid; ②在ANSI C标准中,不允许对void...

by panhuachun - Linux文档专区 - 2008-03-06 18:09:37 阅读(675) 回复(0)

本帖最后由 ankhman 于 2011-12-15 19:58 编辑 /home/ankh/qframework/QfwSeismic_lib-build-desktop-Qt_4_8_0_in_PATH__4_8_0__Debug/../QfwSeismic/QfwSeismicXml/QfwRgbColorFusionModelDom.cpp:49: error: passing ‘const QfwRgbColorFusionModelDom’ as ‘this’ argument of ‘virtual const QfwAbstractHorizonModel* QfwRgbColorFusionModelDom::findHorizonModel(QString, const QList&)’...

by ankhman - C/C++ - 2011-12-15 21:55:56 阅读(1164) 回复(1)

有如下类 class String {public: String(const char *initValue = ""); String(const String &rhs); ~String(); String& operator=(const String &rhs); const char& operator[](int index) const; char& operator[](int index);......}; 和如下语句 String s; .. ... cout <

by blizzard213 - C/C++ - 2008-07-17 19:17:34 阅读(2256) 回复(8)

大家在项目中使用过void *指针吗? 一般用在哪种场合?

by __slucx__ - C/C++ - 2013-09-16 22:44:13 阅读(4266) 回复(11)

void *ttmp=malloc(1024); ((char*)ttmp)++;/ void*不能加,我转换成char*怎么也加不了地址呢???该怎么写才对

by daxiguagg - C/C++ - 2013-07-17 08:46:58 阅读(1113) 回复(5)