《编程之美》第一章 让CPU暂用率听你指挥的粗糙实现,如何控制CPU的暂用率固定在50%#include #include #ifdef __cplusplus extern "C" { #endif #include #ifdef __cplusplus } #endif #define Get....
分类:
其他好文 时间:
2014-07-10 10:36:20
阅读次数:
213
使用静态链接的方式
#include
#include
#include
#ifdef __cplusplus
extern "C" {
#endif
#include "lua/include/lua.h"
#include "lua/include/lauxlib.h"
#include "lua/include/lualib.h"
#pragma comment (li...
分类:
其他好文 时间:
2014-07-01 07:50:09
阅读次数:
189
使用静态链接的方式
#include
#include
#include
#ifdef __cplusplus
extern "C" {
#endif
#include "lua/include/lua.h"
#include "lua/include/lauxlib.h"
#include "lua/include/lualib.h"
#pragma comment (li...
分类:
其他好文 时间:
2014-06-30 18:28:47
阅读次数:
216
BUG 1:GDI+ Image::FromFile 无效
m_pImg = Gdiplus::Bitmap::FromFile(m_imgFilePath);
m_pImg为NULL
原因是没有初始化GDI+。
BUG2:GDI+ new Bitmap不能接受三个参数
//创建目标Bitmap
Bitmap *bmpDest = new Bitmap(destWidth, destHeight, m_pImg->GetPixelFormat());
原因:
//#ifdef _DEBUG
//#...
分类:
其他好文 时间:
2014-06-26 11:59:26
阅读次数:
377
主要难点在于设置recv()与send()的超时时间,具体要注意的事项,请看代码注释部分,下面是代码:[cpp]view plaincopyprint?#include#include#include#include#include#include#ifdef_WIN32///包含winsocket...
在.pch中写:#ifdef DEBUG // 调试阶段#define CXSLog(...) NSLog(__VA_ARGS__)#else // 发布阶段#defineCXSLog(...)#endif
分类:
移动开发 时间:
2014-06-17 14:08:14
阅读次数:
263
- (void)viewDidLoad{ [super viewDidLoad]; #ifdef DEBUG // 设置测试使用的用户名和密码 self.nameText.text = @“xiaoshuai"; self.pwdText.text = @"123"; [self text...
分类:
移动开发 时间:
2014-06-17 13:49:29
阅读次数:
252
本文主要介绍使用Loadrunner进行字符串md5加密的方法。使用Loadrunner进行md5比较简单,首先是加载md5.h头文件,后使用头文件中的加密函数即可。1. md5.h头文件内容如下#ifndef MD5_H#define MD5_H#ifdef __alphatypedef unsi...
分类:
其他好文 时间:
2014-06-16 13:31:16
阅读次数:
220
对于C和C++程序员来说,一定不会对NULL感到陌生。但是C和C++中的NULL却不等价。NULL表示指针不指向任何对象。
NULL是一个宏定义
在C中将NULL定义为void*指针值为0
#define NULL (void*)0
在C++中,NULL被定义为常数0
#ifndef NULL
#ifdef __cplusplus
#define NULL 0...
分类:
编程语言 时间:
2014-06-15 10:22:49
阅读次数:
359
linux下编译hello.c 程序,使用gcc hello.c,然后./a.out就可以运行;在这个简单的命令后面隐藏了许多复杂的过程,这个过程包括了下面的步骤
宏定义展开,所有的#define 在这个阶段都会被展开
预编译命令的处理,包括#if #ifdef 一类的命令
展开#include 的文件,像上面hello world 中的stdio.h , 把stdio.h中...
分类:
系统相关 时间:
2014-06-10 15:11:16
阅读次数:
414