摘要:参考:https://msdn.microsoft.com/en-us/library/x13ttww7(VS.80).aspxhttp://stackoverflow.com/questions/2474945/is-it-safe-to-use-a-boolean-flag-to-stop-a-...
阅读全文
04 2015 档案
摘要:Q. What's the process and threads and what's the difference between them?A. A process is an executing program. One or more threads run in the context ...
阅读全文
摘要:QuestionKey wordsAnwserAassignment operator abstract class It is a class that has one or more pure virtual functions. assignment & initialization ...
阅读全文
摘要:Q: What is virtual function?A: Avirtual function or virtual method is a function or method whose behavior can be overridden within an inheriting class...
阅读全文
摘要:Q: What is a class?A: A class is an expanded concept of a data structure: instead of holding only data, it can hold both data and functions.Q: What ar...
阅读全文
摘要:Q: What is a dangling pointer?A: A dangling pointer arises when you use the address of an object after its lifetime is over. This may occur in situati...
阅读全文
摘要:Q: What is the difference betweennew/delete and malloc/free?A: Malloc/free do not know about constructors and destructors. New and deletecreate and de...
阅读全文
摘要:Constructors/Destructors.我们都知道,在C++中建立一个类,这个类中肯定会包括构造函数、析构函数、复制构造函数和重载赋值操作;即使在你没有明确定义的情况下,编译器也会给你生成这样的四个函数。例如以下类: class CTest{public: CTest(); ...
阅读全文
摘要:参考:http://www.renfei.org/blog/mac-os-x-terminal-101.htmlOne command line includes 4 parts:Command Name、Options、Arguments、Extras .man : Give the manua...
阅读全文
摘要:1.简述sizeof和strlen的区别 最常考察的题目之一。主要区别如下: 1)sizeof是一个操作符,strlen是库函数。 2)sizeof的参数可以是数据的类型,也可以是变量,而strlen只能以结尾为‘\0‘的字符串作参数。 3)编译器在编译时就计算出了...
阅读全文
摘要:注: 如下的题目皆来自互联网,答案是结合了自己的习惯稍作了修改。1. 求一个数的二进制中的1的个数。int func(int x){ int count = 0; while (x) { count++; x = x& (x - 1); } ...
阅读全文