随笔分类 -  C/C++

摘要:std::string getFileDir(const char* pFilePath){ assert(pFilePath); std::string strDir = pFilePath std::string::size_type begin = 0; std::string::size_type end = 0; end = strDir.find_last_of("/"); if(end != std::string::npos) { // end+1 : 包括最后一个“/” strDir =... 阅读全文

posted @ 2012-03-31 15:56 甲骨魚 阅读(184) 评论(0) 推荐(0)

摘要:/*---------------HeadFile------------*/#ifndef __CSLOG_H__#define __CSLOG_H__namespace cs{ void CSLog(const char* pszFormat, ...);}#endif/*-------------CppFile----------------*/#include "cslog.h"#include<stdarg.h>const int g_nMaxLogLen = 255;namespace cs{ void CSLog(const char* pszFo 阅读全文

posted @ 2012-03-31 15:43 甲骨魚 阅读(226) 评论(0) 推荐(0)

摘要:再谈typedef(重点为函数指针) 2009-09-17 10:15:43|分类: linux学习 |字号订阅有种很方便的写法。typedef int *p;p pointer;这时直接把pointer带入原式中,取代p然后去掉typedef,得到的结果就是int * pointer;哈哈,这样直接替换就很直观多了。C语言语法简单,但内涵却博大精深;如果在学习时只是止步于表面,那么往往后期会遇到很多困 难。typedef是C语言中一个很好用的工具,大量存在于已有代码中,特别值得一提... 阅读全文

posted @ 2012-03-30 17:46 甲骨魚 阅读(203) 评论(0) 推荐(0)

导航