STL的string类如何实现CString的Format功能 这是一个经典问题,记住

来源:互联网 发布:php获取apk版本号 编辑:程序博客网 时间:2024/05/17 10:05

STL的string类如何实现CString的Format功能?+STL中将int转换为string
  这是一个经典问题,记住
  
  #include<sstream>
  
  std::CString itos(int arg)
  {
      std::ostringstream buffer;
      buffer << arg; // send the int to the ostringstream
      return buffer.str(); // capture the CString
  }

原创粉丝点击