1.cout<<str
2.printf()输出

#include "stdafx.h"
#include<string>
using namespace std;
int main()
{
   string str="abcd";
   printf("%s\n",str.c_str());//将string型str使用c_str()变为字符数组;
    return 0;
}

string的输出

相关文章:

  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-30
  • 2022-02-16
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
  • 2022-12-23
  • 2021-05-09
  • 2022-12-23
相关资源
相似解决方案