#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
using  namespace std;
int main(){

	string s = "哈哈";

	cout << s << endl;

	printf("a=%s", s.c_str());

	
	std::cout << "Enter two numbers:" << std::endl;
	system("pause");
}

printf 输出字符串 需要加上 c_str()

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案