How to convert a number to string and vice versa in C++

前端 未结 5 860
鱼传尺愫
鱼传尺愫 2020-11-22 03:36

Since this question gets asked about every week, this FAQ might help a lot of users.

  • How to convert an integer to a string in C++

  • how to con

5条回答
  •  渐次进展
    2020-11-22 04:02

    #include 
    #include 
    using namespace std;
    int main() {
       string s="000101";
       cout<

    Output:

    • 000101
    • 101
    • 1011

提交回复
热议问题