淡水求咸

博客园已经停止更新,请移步 http://lovecjh.com/

导航

2012年6月27日

convert between char* and std::string

摘要: char* to std::string std::string has a constructor for this: const char *s = "Hello, world!";std::string str(s); note: Make sure thar your char* isn't NULL, or else the behavior is undefined. if you already know size of the char*, use this insteadchar* data = ...;int size = ...;std::st 阅读全文

posted @ 2012-06-27 07:46 深圳彦祖 阅读(3241) 评论(0) 推荐(0) 编辑