c++ - Compiler ignores object declaration inside a class assumes it to be int -
i using visual studio compiling code , pretty new coding. have make order class object of ean class data member. when compile code shows error in class declaration .
the error : syntax error : missing ';' before identifier 'ean_o'
error c4430: missing type specifier - int assumed. note: c++ not support default-int
class order { int ordered; int delivered; ean ean_o; bool empty; public: order(); order(const ean& ); ean& getean(); int outstanding() const; bool add(std::istream& is); bool add(int n); bool receive(std::istream& is); void display(std::ostream& os) const; };
assuming have ean class created, must include order header
#include "ean.h" the best thing include ean.h here , not not include in main. once include order.h in main, ean.h order.h
Comments
Post a Comment