1. 程式人生 > >[c++] string不能直接用cout輸出

[c++] string不能直接用cout輸出

#include <iostream>
using namespace std;
int main()
{
	string str_test = "helloworld";
	cout << str_test.c_str() << endl;
	return 0;
}

 執行結果: