-3

I am copying this directly from a textbook.

#include <iostream>
using namespace std;

int main()
{
    string myHello = "This is Chapter 3 already?"; 

    cout << myHello << endl; //this part is not working

    return 0;
}

Why isn't this code working?

I have tried looking through the book for solutions but no solution is provided or available.

4

1 回答 1

7

你需要#include <string>然后它会起作用,在using namespace命令上方执行它,如果你摆脱了你需要做的命名空间命令std::string myhello;

#include <string>

于 2013-08-27T02:28:16.573 回答