ChinaUnix.net
相关文章推荐:

parsing const as this argument of discards qualifiers

刚才重写 printf 运行正常,但是编译给出一个警告 [code]LTIO.c:10: warning: initialization discards qualifiers from pointer target type[/code] 这一行代码如下 [code]void * c = str;[/code] 其中str为 [code]const void* str;[/code]

by net_robber - C/C++ - 2006-12-29 09:14:30 阅读(17305) 回复(6)

相关讨论

问个关于拷贝构造函数的问题: //test.cpp class A{ private: int i; public: A(int x = 2): i(x) { } A(const A &a){ i = a.getValue();////////////////////////this line? } int getValue(){ return i; } }; int main() { A a1(3); A a2(a1); } 编译错误是: test.cpp: In copy constructor `A::A(const A&)': test.cpp:7...

by wbyanhust - C/C++ - 2006-09-14 20:24:39 阅读(1131) 回复(1)

Condition: a. Cisco running PVST+ b. Native VLAN on trunk port is VLAN 4c. 802.1q trunkingd. port-channel1 is combination of f1/13 and f1/15 (trunk port)e. f1/14 is the other trunk port on switch ***************************************************************** SW2#sh spanning-tree root brief Root Hello Max FwdVlan Root ID ...

by johnny_jiang - 网络技术文档中心 - 2007-11-14 22:31:06 阅读(820) 回复(0)

:em11::em11: 共享资料。 http://ajax.cnrui.cn/soft/UploadFile/Perl/Apress.Pro.Perl.parsing.Aug.2005.rar 给个链接 [ 本帖最后由 YGC 于 2007-4-27 10:57 编辑 ]

by YGC - Perl - 2007-05-06 14:23:17 阅读(983) 回复(2)

[root@linux shell]# iptables -A FORWARD -m ipp2p --ipp2p -j MARK --set-mark 0x01 iptables: Invalid argument 这是怎么回事儿???

by lovegqin - 网络与硬件 - 2006-10-06 21:18:16 阅读(965) 回复(3)

有如下类 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 阅读(1770) 回复(8)

The Digester framework is a high-level interface that parses an XML stream and populates the data into Java objects based on rules provided to the Digester component. Among the other XML parsing options available, the Digester package offers greater simplicity. With very simple classes and a collection of predefined Rules included, Digester simplifies the parsing of complex XML schema. Because ...

by shadow-lx - Java文档中心 - 2006-07-25 17:15:11 阅读(658) 回复(0)

Hash: SHA1 ============================================================================= FreeBSD-SA-03:13.sendmail Security Advisory The FreeBSD Project Topic: a third sendmail header parsing buffer overflow Category: contrib Module: contrib_sendmail Announced: 2003-09-17 Cred...

by dinga - BSD - 2003-09-18 14:25:44 阅读(657) 回复(0)

class example { public: operator const TInt() const { return ret; } TInt ret; } 上面代码中两个const的意义,help;

by woxinfeixiang - C/C++ - 2009-08-04 18:57:03 阅读(676) 回复(3)

#include using std::string; class A { public:     inline const string& get()     {         return m_str;     } private:     string m_str; }; class B { public:     void fun(const A& a)     {       &n...

by zhongyj - C/C++ - 2008-10-31 16:19:05 阅读(952) 回复(2)

C/C++中const用的很多,但是总让人犯迷糊。总结下它的用法,如果说的不对还请指正。 1、const修饰的后的对象不是一个常量,它只表示修饰的对象是个只读的对象。 可以用下面的方法证明: const int a = 1; switch(i) { case a: ... break; case 2: ... break; default: ... break; } 如果i等于1,不会执行case a: 后面的语句。 2、const修饰后的对象,默认的表示此对象只能在该文件中用。 如:const int a = 1; 等同...

by liaoweijun - C/C++ - 2008-07-24 15:59:02 阅读(9908) 回复(49)