C++ int转string string转int int转二进制

来源:互联网 发布:eia数据对黄金的影响 编辑:程序博客网 时间:2024/05/22 11:46


#include <iostream>#include<bitset>#include <string>using namespace std;int main() {string str="12345678";int number = std::atoi(str.c_str());cout << "str to int use       std::atoi(str.c_str())                 "<<number << endl;int n = 314061410;string text_str = to_string(n);cout << "int to str use             to_string()              " << text_str << endl;bitset<8> b(127);cout << b << endl;system("pause");return 0;}




0 0