- 博客(9)
- 资源 (3)
- 收藏
- 关注
原创 C++ windows multithread 多线程编程(一)
多线程编程使用createthread需要提供LPTHREAD_START_ROUTINE线程函数,线程函数的签名为 void (*) (void * lpParam)对于类静态函数或者全局函数,需要在LPTHREAD_START_ROUTINE强制定义ThreadProc类静态函数:需要(LPTHREAD_START_ROUTINE)Class::StaticFunction
2012-11-23 17:42:57 2406
原创 C++使用技巧:copy and swap idiom
Copy and Swap idiom使用到著名的Big three中兩個特殊的成員函數(拷貝構造函數copy construction與賦值構造函數assignment constrcution). 作用在于在深拷贝的过程中保证强异常的作用,具体代码如下class Person{public: Person(int id, const char * pszName):_id(i
2012-11-20 19:58:15 916 1
原创 Windows开发实录
饭是一口一口吃的...预编译 PrecompilerCompiling C++ code is a long, slow process, especially compiling window API or other API library(boost).The Microsoft compiler can ameliorate this problem with a si
2012-11-17 14:07:30 475
原创 C++ Mac OS program
Mac XCode program1. Add additional header/librariesFor XCode project, add the "Header Search Paths" or "Library Search Paths" under "Search Paths" in xcodeproj.2. Add additional link flagsFor
2012-11-15 21:28:05 955
原创 C++ boost usage
Install BOOST1. Build from source codeDownload the new release package from boost official websiteFor windows, download zip or 7z format and unpack it using 7zip or winrarFor linux/mac os, dow
2012-11-15 08:55:43 857
原创 C++ Various String Types (char, wchar_t, string, wstring, cstring)
convert char * to wchar_t *using mbstowcs function char psz[] = {"helloworld\0"}; wchar_t pwsz [10] = {0}; int len = strlen(psz); int ret = mbstowcs(pwsz, psz, min(len, 10)); cout<<ret<<endl
2012-11-08 16:05:16 497
原创 C++ Macro Usage
Debug logSometimes we need to print some logs to show the application is running well during debug. But for release version, we choose to ignore these logs.So we can use macros to finish these fun
2012-11-08 12:56:15 1074
原创 c++ stl 算法使用
associated container: setCompare between setsif you want to find the different elements in one set to another set, you could use the std::set_difference method int i = 0; set s1 = boost::as
2012-11-07 15:56:05 710
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人