I tried to make a header called Paitent_info.h as you can see here :
#ifdef GUARD_Paitent_info
#define GUARD_Paitent_info
#include <iostream>
#include <string>
#include <vector>
struct Paitent_info {
std::string name;
std::vector<double> tem;
};
bool compare(const Paitent_info&, const Paitent_info&);
std::istream& read(std::istream&, Paitent_info&);
std::istream& read_tem(std::istream&, std::vector<double>&);
#endif
and here is Paitent_info.cpp :
#include "Paitent_info.h"
using std::istream; using std::vector;
bool compare(const Paitent_info& x, const Paitent_info& y)
{
return x.name < y.name;
}
istream& read(istream& ip, Paitent_info& p)
{ // do something
return ip;
}
istream& read_tem(istream& in, vector<double>& tem)
{ // do something
return in;
}
I got many error messages from this code :
- std::istream and std::vector has not been declared
- Paitent_info does not name a type.
- request for member ‘name’ in ‘x’ and 'y', which is of non-class type ‘const int’.
- istream does not name a type.
I do not know why I got all these error messages, please help me.