![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++,C
隔壁打杂的
Jason
展开
-
使用malloc/new后free/delete崩溃错误解决
std::string sFile_L = "home/o/program/luaqibazao789"; char *p = (char*)malloc(32*sizeof(char*)); if(!p) break; memset(p, 0, 32); int nsize = sFile_L.length(); memcpy(p, sFile_L.c_str(), nsi原创 2017-06-28 10:33:06 · 954 阅读 · 0 评论 -
终端中传入的相对路径转换为绝对路径
#define MAX_BUFFER 2048 inline static std::string abs_path(const char* srcpath) { std::string strAbsolutionpath = ""; char abspath[MAX_BUFFER] = {0}; #ifdef _WIN32 if(_fullpath(absp原创 2017-06-19 16:36:30 · 655 阅读 · 0 评论