摘要:What is WPF?WPF (Windows Presentation foundation) is a graphical subsystem for displaying user interfaces, documents, images, movies etc in windows ap...
阅读全文
随笔分类 - Quiz
摘要:A binary tree is defined as a tree where each node can have no more than two children.Building a Binary Search Tree:首先创建一个节点Class public class BtNo...
阅读全文
摘要:A abstract class An abstract class is a class that must be inherited and have the methods overridden. It can not be instantiated. And at least one of
阅读全文
摘要:1. Convert string from "AAABBCC" to "A3B2C2". 当面试者提出这个问题的时候,首先需要确认题意:譬如:字符串是不是顺序的,是否有字符重复出现。 例如: ABBAACB , AAABBCCCBBAA。 如果是顺序的话可以一次遍历字符,如果是杂序的话,需要2次遍
阅读全文
摘要:这个是非常基本的一道面试题,但是要考虑周全。首先反转一个字符串:基本思路是变成Char数组,然后调用C#里面的方法,或者设定两个index,从头,尾向中间遍历,并交换。方法一: Array.Reverse(char *). 注意在开始的时候要判断字符串为null或空。 public s...
阅读全文
摘要:const int amust be initializedinitialization must be at compile timereadonly int acan use default value, without initializinginitialization can be at ...
阅读全文
摘要:C Statichttp://stackoverflow.com/questions/572547/what-does-static-mean-in-a-c-programStatic could be used for (1) variable and (2) function.A static ...
阅读全文
摘要: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 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(); ...
阅读全文
摘要: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); } ...
阅读全文
摘要:1.new、delete、malloc、free关系new/delete是C++的运算符。new 调用构造函数用于动态申请内存,delete调用对象的析构函数,用于释放内存。malloc与free是C++/C语言的标准库函数, 也是用来申请和释放内存。由于malloc/free是库函数而不是运算符,...
阅读全文