怎么用cin来串?

Yod*_*oda 2 c++ string cin char

我有: string ipAddress;

当我尝试:cin>>ipAddress;我得到

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\r\documents\visual studio 2013\projects\chat\chat\chat.cpp 158 1   Chat
Run Code Online (Sandbox Code Playgroud)

如何替换这个指令?

标题:

#include "stdafx.h"
#include "Socket.h"
#include <iostream>
#include <winsock2.h>
#pragma comment(lib, "Ws2_32.lib")
using namespace std;
Run Code Online (Sandbox Code Playgroud)

Tho*_*ews 5

尝试包含std::stringby的函数声明:
#include <string>