
C++
文章平均质量分 65
kuailekemi
这个作者很懒,什么都没留下…
展开
-
一个简单的多线程例子-临界区
// Critical.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include using namespace std;static int nGloble = 0;CRITICAL_SECTION gcs;DWORD WINAPI R原创 2013-03-05 15:11:14 · 1342 阅读 · 0 评论 -
一个简单的多线程例子-互斥量
// Mutex.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include using namespace std;DWORD WINAPI Func1Proc(LPVOID lpParam);DWORD WINAPI Func2Proc(LP原创 2013-03-05 14:26:41 · 926 阅读 · 0 评论 -
stl vector
// stl-vector.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include using namespace std;void useVector(){ vector aa; int num = 0; aa.reserve(11原创 2013-03-06 17:31:36 · 660 阅读 · 0 评论 -
__cdecl, _stdcall , PASCAL, _fastcall, _thiscall
来自百度百科 几种函数调用方式__cdecl 是C Declaration的缩写(declaration,声明),表示C语言默认的函数调用方法:所有参数从右到左依次入栈,这些参数由调用者清除,称为手动清栈。被调用函数不会要求调用者传递多少参数,调用者传递过多或者过少的参数,甚至完全不同的参数都不会产生编译阶段的错误。_stdcall 是StandardCall的缩写,是C++的标准转载 2013-02-28 15:13:27 · 430 阅读 · 0 评论 -
为什么要加#include "stdafx.h"
所谓头文件预编译,就是把一个工程(Project)中使用的一些MFC标准头文件(如Windows.H、Afxwin.H)预先编译,以后该工程编译时,不再编译这部分头文件,仅仅使用预编译的结果。这样可以加快编译速度,节省时间。预编译头文件通过编译stdafx.cpp生成,以工程名命名,由于预编译的头文件的后缀是“pch”,所以编译结果文件是projectname.pch。编译器通过一转载 2013-04-04 00:06:18 · 700 阅读 · 0 评论