我想实现一个成员匹配这个函数的类:
int get(
string &host_,
string &port_,
string url_path,
ostream &out_,
vector<string> &headers,
unsigned int timeout
)
我有这个:
#include <string>
#include <vector>
#include <iostream>
#include <istream>
#include <ostream>
#include "Register.h"
using namespace std;
class Request : public Register {
private:
string *host;
string *port;
string *url;
ostream *out;
vector<string> *header;
unsigned int *timeout;
public:
Request() {
this -> host = new string();
this -> port = new string();
this -> url = new string();
this -> out = new ostream();
this -> header = new vector<string>();
this -> timeout = new int();
}
但我无法实例化它。例如,ostream 是怎么回事:
this -> out = new ostream();
我还是 C++ 的新手,现在我完全糊涂了,我在 Google 上找不到正确的答案。