-1

I have have this code, but it's not compiling correctly. When I compile this code

#include "stdafx.h"
#include <iostream>

using namespace std;

int main()
{
    string stringone;
    stringone = "abcdef";
    cout << stringone << endl;
    return 0;
}

The compiler tells me this error:

error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)

Mooing Duck
  • 64,318
  • 19
  • 100
  • 158

1 Answers1

7

You need to use #include <string> as well.

Zeenobit
  • 4,954
  • 3
  • 34
  • 46