将int 转换为string 函数 to_string()

1.头文件 #include<cstring>

2.功能

#include <iostream>     
#include<cstring> 
using namespace std;
int main ()
{ int m=100;
  string str=to_string(m);
  cout<<str[0];
  return 0;
}

 

posted @ 2020-08-05 18:16  miao-xixixi  阅读(206)  评论(0编辑  收藏  举报