Help Needed with Visual Studio Express IDE

I need some help compiling code in the Visual Studio Express 2013 IDE.

I'm trying to compile this code:

1
2
3
4
5
6
7
8
9
10
11
#include <iostream>

using namespace std;

int main()
{
	cout << "Please enter your first name (followed by 'enter'):\n";
	string first_name;              // first_name is a variable of type string
	cin >> first_name;             // read characters into first_name
	cout << "Hello, " << first_name << "!\n";
}


And I'm getting these errors:

Error 1 error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion) c:\users\osman\programming\stroustrup_programming_using_c++\consoleapplication2\consoleapplication2\name.cpp 9 1 ConsoleApplication2
Error 2 error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion) c:\users\osman\programming\stroustrup_programming_using_c++\consoleapplication2\consoleapplication2\name.cpp 10 1 ConsoleApplication2
3 IntelliSense: no operator ">>" matches these operands
operand types are: std::istream >> std::string c:\Users\Osman\programming\stroustrup_programming_using_c++\ConsoleApplication2\ConsoleApplication2\name.cpp 9 6 ConsoleApplication2
4 IntelliSense: no operator "<<" matches these operands
operand types are: std::basic_ostream<char, std::char_traits<char>> << std::string c:\Users\Osman\programming\stroustrup_programming_using_c++\ConsoleApplication2\ConsoleApplication2\name.cpp 10 20 ConsoleApplication2


How do I fix this? Someone who happens to be familiar with this particular IDE, please help me out. Thanks in advance.
Nothing to do with visual studios. You have to #include <string> to use string, that'll fix your problem :)
Topic archived. No new replies allowed.