compile error C2228 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

compile error C2228

left of '.push_back' must have class/struct/union void Database::append(Account const& db) { Accounts.push_back(db); }; Accounts is highlighted and its telling me expression must have class type.

30th Nov 2018, 10:12 PM
Brandon Autry
Brandon Autry - avatar
1 Answer
+ 2
Kindly post the complete code, or just the declaration of Accounts and the Account class. The information provided so far was not sufficient to determine why the error showed up.
1st Dec 2018, 3:00 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar