C++
scutth
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LARGE_INTEGER类型 和 QueryPerformanceFrequency()
LARGE_INTEGER是union; 用于表示一个64位有符号整数值.其他定义如下: typedef union _LARGE_INTEGER { struct {转载 2011-09-19 13:20:44 · 693 阅读 · 0 评论 -
由NT Service中调用SendInput模拟键盘鼠标事件了解到的
//TODO原创 2013-05-09 16:23:50 · 1123 阅读 · 0 评论 -
C++实现多线程安全的单体模式(Singleton)
单体模式算是最简单的设计模式,不考虑多线程,我们可能会写出这样的代码: class Singleton { public: static Singleton* getInstance(); protected: Singleton(){}; ~Singleton(){}; private: static Singleton* Instance; }; Singleton* Single原创 2012-09-19 22:54:34 · 3327 阅读 · 0 评论 -
Windows7下Qt开发环境搭建
首先是软件准备: 需要下载两个软件 qt-win-opensource-4.4.0-mingw(ftp://ftp.trolltech.com/qt/source/qt-win-opensource-4.4.0-mingw.exe) MinGw(http://www.mculee.cn/upload/MinGW-3.4.2.exe) 软件安装过程: 先安装MinGW。路径尽量短,原创 2011-11-23 12:58:55 · 3864 阅读 · 2 评论 -
C++ 二叉树的构建,先序/中序/后序的递归/非递归实现
//BinNode.h #ifndef BINNODE_H #define BINNODE_H class BinNode { public: BinNode():data(0),lchild(0),rchild(0){}; BinNode *lchild,*rchild; char *data; }; #endif //BinTree.h #ifndef BINTREE_H原创 2012-04-03 13:00:42 · 1842 阅读 · 0 评论 -
一个空的类到底有什么
class Empty{}; 应该是只有四个的:默认构造函数,析构函数,复制构造函数,赋值运算符. 也即是会默认生成以下东西: class Empty { public: Empty(); Empty(const Empty&); ~Empty(); Empty& operator=(const Empty& rhs); }; Effective C++ 第二版勘误: h原创 2011-12-19 23:46:45 · 687 阅读 · 0 评论 -
C++能做什么
C++ Applications 2011年6月18日更新 这里有一个有关系统、应用程序和库的列表,列表中的全部或者大部分代码用C++编写,当然,该列表并不全面。即使我如何努力,我也不能列举一个含有 1000个主要由C++编写的程序列表,但是这里的列表可能包含我听说过程序之中的第1000个。这是一个包括系统、应用程序和库的列表,读者可能熟悉其中的一些,新手可能有个概念C++能做什么,或者我仅仅转载 2011-11-05 13:02:26 · 9111 阅读 · 0 评论 -
C++中定义与声明
定义一定是声明,声明不一定是定义: 比如int a; 这是一个定义,同时也是一个声明,声明a是一个整型变量,同时为a分配内存单元。 声明和定义的本质区别在于是否为变量分配了内存空间,就像上面的例子 定义了一个变量a,因为为a分配了内存空间; 同时也是对a的声明,声明a是一个int变量; 举个是声明不是定义的例子: extern int a; 这就是一个声明,而不是定义,声明原创 2011-11-05 12:59:33 · 675 阅读 · 0 评论 -
C++中生成任意范围内随机数的方法
//该宏定义需要放在所有头文件的前面,否则可能编译通不过 #define _CRT_RAND_S #include #include using namespace std; //产生随机数,其中范围为min~max unsigned int Random(int min,int max) { errno_t err; unsigned int number; err原创 2011-10-21 20:34:16 · 1693 阅读 · 0 评论 -
在case语句中定义变量的问题
今天在实验室,同学问了一个在case中定义变量的问题,例如: switch(n) { case 1:int i=0;break; case 2:....;break; case 3:....;break; default:....... } 编译器会报错: 错误: 跳过了‘int i’的初始化 如果我们这原创 2011-10-21 20:27:54 · 10499 阅读 · 4 评论 -
implementation of General Sort Algorithm - mark
#include using namespace std; void print(int value [], int length) { for (size_t i = 0; i < length; i++) { cout << value[i] << " "; } cout << endl; } void exchange(int &a, int &b) { int tem原创 2013-10-08 15:55:09 · 648 阅读 · 0 评论
分享