美文网首页
c++ 默认类型转化的坑

c++ 默认类型转化的坑

作者: sealwang24 | 来源:发表于2021-05-07 11:03 被阅读0次
      1 // to_string example
      2 #include <iostream>   // std::cout
      3 #include <string>     // std::string, std::to_string
      4  #include <typeinfo>
      5 using namespace std;
      6 int main ()
      7 {
      8    int c = 1;
      9    std::string a;
     10    a = c;
     11    cout << a ;
     12    return 0;
     13 }
    

    既然能编译过
    然后,输出为空

    相关文章

      网友评论

          本文标题:c++ 默认类型转化的坑

          本文链接:https://www.haomeiwen.com/subject/awjsdltx.html