Please help with this: "Expected declaration before '}' token " error in C++ | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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?

6th Dec 2021, 5:32 AM
Kami
2 Respostas
+ 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
6th Dec 2021, 6:04 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 2
Thanks a lot.
6th Dec 2021, 7:51 AM
Kami