g++ main.cpp user.cpp ad.cpp
user.h:29: error: ISO C++ forbids declaration of 'vector' with no type
user.h:29: error: expected ';' before '<' token
Here is my user.h file:
I'd appreciate it if someone could help me with this. Commenting out the bolded line of code makes my programs compile perfectly.Code:#ifndef _user_h_ #define _user_h_ #include <string> #include <vector> #include "ad.h" using std::string; class user { public: // CONSTRUCTORS user(const string& _ID) : ID(_ID) {} // ACCESSORS const string& id() const { return ID; } // MUTATORS void add_keyword(const string& _keyword, const string& _URL, const float& _PC, const float& _CC, bool& _is_new); bool ad_for_keyword(const string& _keyword, const string& _URL, const float& _PC) const; bool click(const string& _keyword, const string& _URL) const; bool remove(const string& _keyword) const; void statistics(std::ostream & output_ofs); private: // REPRESENTATION string ID; vector<ad> ads; }; #endif
EDIT: Also, I'd appreciate if you didn't post any specific code to help me (stuff like the 2nd post is ok), not that I think this question needs it. My instructors allow me to seek help on comprehending error messages, but not get code from outside sources.



LinkBack URL
About LinkBacks



