C++和C在字符串的定义有一定的区别的
#include <iostream>
#include <ctime>
#include <string>//c++中字符串需要添加这个头文件
using namespace std;
int main()
{
/*c语言风格*/
char str[] = "Hello C string";
cout << str << endl;
/*c++语言风格*/
string strc = "Hello C++ string";
cout << strc << endl;
system("pause");
return 0;
}