2014年4月26日
摘要:
被extern "C"修饰的变量和函数是按照C语言方式编译和连接的;未加extern“C”声明时的编译方式。首先看看C++中对类似C的函数是怎样编译的。作为一种面向对象的语言,C++支持函数重载,而过程式语言C则不支持。函数被C++编译后在符号库中的名字与C语言的不同。例如,假设某个函数的原型为:v...
阅读全文
posted @ 2014-04-26 10:43
上海—Michael
阅读(175)
推荐(0)
2014年4月25日
摘要:
编写DLL时的函数与一般的函数方法基本一样。但要对库中的函数进行必要的声明,以说明哪些函数是可以导出的,哪些函数是不可以导出的。把DLL中的函数声明为导出函数的方法有两种:一是使用关键字_declspec(dllexport)来声明。二是在.def文件中声明。一、使用关键字_declspec(dll...
阅读全文
posted @ 2014-04-25 17:29
上海—Michael
阅读(260)
推荐(0)
摘要:
字符串前面加L表示该字符串是Unicode字符串。_T是一个宏,如果项目使用了Unicode字符集(定义了UNICODE宏),则自动在字符串前面加上L,否则字符串不变。因此,Visual C++里边定义字符串的时候,用_T来保证兼容性。VC支持ascii和unicode两种字符类型,用_T可以保证从...
阅读全文
posted @ 2014-04-25 16:48
上海—Michael
阅读(3780)
推荐(0)
2014年4月23日
摘要:
Few days ago,I opened the Genesys demo VM by VMware Server 1.0.4 and got an error like this: "Configuration file was created by a VMware product with...
阅读全文
posted @ 2014-04-23 09:38
上海—Michael
阅读(967)
推荐(0)
2014年4月21日
摘要:
#include"stdafx.h"#include #define DATALEN 56#define KEY_SIZE 8typedef struct _RECORD { TCHAR key[KEY_SIZE]; TCHAR data[DATALEN];} RECORD;#define RECS...
阅读全文
posted @ 2014-04-21 17:56
上海—Michael
阅读(373)
推荐(0)
2014年4月17日
摘要:
平衡二叉树(Balanced binary tree)是由阿德尔森-维尔斯和兰迪斯(Adelson-Velskii and Landis)于1962年首先提出的,所以又称为AVL树。定义:平衡二叉树或为空树,或为如下性质的二叉排序树:(1)左右子树深度之差的绝对值不超过1;(2)左右子树仍然为平衡二...
阅读全文
posted @ 2014-04-17 16:58
上海—Michael
阅读(7095)
推荐(0)
2014年4月15日
摘要:
volatile变量直接在CPU和内存之间交换,不通过一级、二级缓存。考虑下面的代码:代码:123456789101112131415161718class Gadget{public:void Wait() {while (!flag_){Sleep(1000); // sleeps for 10...
阅读全文
posted @ 2014-04-15 15:47
上海—Michael
阅读(224)
推荐(0)
摘要:
本机:win7(x86),4G内存#include"stdafx.h"#include#include#include#includeusing namespace std;HANDLE hHeap;int _tmain(int argc, _TCHAR* argv[]){ SYSTEM_INFO ...
阅读全文
posted @ 2014-04-15 13:23
上海—Michael
阅读(1025)
推荐(0)
摘要:
#include #include #include using namespace std; int main() { SYSTEM_INFO systemInfo; GetSystemInfo(&systemInfo); cout <<setw(20) << "处理器掩...
阅读全文
posted @ 2014-04-15 12:37
上海—Michael
阅读(350)
推荐(0)
2014年4月14日
摘要:
1>e:\vs2010\vc\include\cmath(19):errorC2061:语法错误:标识符“acosf”1>e:\vs2010\vc\include\cmath(19):errorC2059:语法错误:“;”1>e:\vs2010\vc\include\cmath(19):errorC...
阅读全文
posted @ 2014-04-14 11:05
上海—Michael
阅读(1365)
推荐(0)