随笔分类 - C++/CLI
VC++.net
摘要:C and C++ enforce subtle differences on the expressions to the left and right of the assignment operator If you've been programming in either C or C++ for a while, it's likely that you've heard the te...
阅读全文
摘要:转自:http://www.cnblogs.com/chio/archive/2009/03/20/931043.html题目如下:问下列代码的打印结果为0吗?#include<stdlib.h>#include<iostream>usingnamespacestd;structCLS{intm_i;CLS(inti):m_i(i){}CLS(){CLS(0);}};int...
阅读全文
摘要:C++ 虚函数表解析(转) C++ 虚函数表解析前言C++中的虚函数的作用主要是实现了多态的机制。关于多态,简而言之就是用父类型别的指针指向其子类的实例,然后通过父类的指针调用实际子类的成员函数。这种技术可以让父类的指针有“多种形态”,这是一种泛型技术。所谓泛型技术,说白了就是试图使用不变的代码来实现可变的算法。比如:模板技术,RTTI技术,虚函数技术,要么是试图做到在编译...
阅读全文
摘要:Question #49: What is the output of the program? 55% on 10074 times asked #include <iostream> class Foo { public: char c; static double sd; double d; int i; }; int main(int argc, char** argv) { ...
阅读全文
摘要:Question #15: Which of the following functions are found when called in main during name lookup? 55% on 10310 times asked #include <iostream> namespace standards { struct datastructure { }; void...
阅读全文
摘要:Question #8: Given the code below, the variable y can be accessed in which blocks of code? 55% on 11229 times asked 1 int main(int argc, char** argv) 2 { 3 4 if ( argc > 10) ) 5 { 6 7 } 8 else if...
阅读全文
摘要:Question 1Can you name the special functions a C++ compiler can create implicitly?tip answerQuestion 2What are the two ways to achieve automatic type conversion from type X to type Y?tip answerQuestio...
阅读全文
摘要:When an executable file is invoked, the operating system loader creates the virtual address space for the process. Then the loader maps the executable module into the process' address space. The loade...
阅读全文
摘要:Compiler Error C2552 non-aggregates cannot be initialized with initializer list. This error beacuse of the following..... The specified identifier was incorrectly initialized.An initializer list is ne...
阅读全文
摘要:大龙的博客 C++博客 | 首页 | 发新随笔 | 发新文章 | 联系 | 聚合 | 管理 ...
阅读全文
摘要:转自:http://www.cnblogs.com/CUCmehp/archive/2009/01/12/1374320.html C++函数后面后加到关键字throw(something)限制,是对这个函数的异常安全性作出限制。void f() throw() 表示f不允许抛出任何异常,即f是异常安全的。void f() throw(...) 表示f可以抛出任何形式的异常。void f(...
阅读全文

浙公网安备 33010602011771号