+ 2
Please help with this: "Expected declaration before '}' token " error in C++
This is the header code: #ifndef ZODIAC_H #define ZODIAC_H class zodiac { public: zodiac() {} void setChar() {} } std::string zodiacsign; std::string nickname; std::string att; int fd, td, fm, tm; }; #endif // ZODIAC_H When I run this I get this error message. Anyone know why?
2 Antworten
+ 5
After void set char there is one extra parenthesis  } remove it 
#ifndef ZODIAC_H
#define ZODIAC_H
class zodiac
{
    public:
        zodiac() {}
        void setChar() {}
        
        std::string zodiacsign;
        std::string nickname;
        std::string att;
        int fd, td, fm, tm;
};
#endif // ZODIAC_H
+ 2
Thanks a lot.




