
C++
右手边的蓝天
每天没提新问题的人,没资格睡觉。
展开
-
C++ char*,const char*,string的相互转换
转载自:https://www.cnblogs.com/wxmdevelop/p/4567857.htmlC++ char*,const char*,string的相互转换1. string转const char*string s ="abc";constchar* c_s = s.c_str();2. const char*转string 直接赋值即可constch...转载 2018-07-31 16:45:54 · 2971 阅读 · 0 评论 -
C/C++ 数学函数 ceil(), floor(), round()
原文链接:http://zebozhuang.blog.163.com/blog/static/1714798042011325111616224/用法:ceil(x)返回不小于x的最小整数值(然后转换为double型)。floor(x)返回不大于x的最大整数值。round(x)返回x的四舍五入整数值。给个例子test.c: #include <stdio.h&...转载 2018-08-03 10:16:31 · 328 阅读 · 0 评论 -
const char*转换成wstring类型
转载自:https://blog.youkuaiyun.com/cqltbe131421/article/details/52597813直接上代码: std::wstring CATOW(const char* lpcszString)//返回值类型是wstring类型{ int unicodeLen = ::MultiByteToWideChar(CP_ACP, 0, lpcszStrin...转载 2018-09-13 00:01:40 · 958 阅读 · 0 评论 -
C++ 读写utf-8文件
转载自:https://blog.youkuaiyun.com/sdscscs22/article/details/53895416UTF-8UTF-8(8-bit Unicode Transformation Format)是一种针对Unicode的可变长度字符编码,又称万国码。由Ken Thompson于1992年创建。现在已经标准化为RFC 3629。UTF-8用1到4个字节编码Unicode字...转载 2018-09-13 00:04:58 · 10068 阅读 · 0 评论