Hello everyone, so I have the following code for a school project. I have included the code and errors, would someone mind helping me on where i went wrong here?
When I attempt to compile this, I get the following errors:
1 2 3 4 5 6 7 8 9
Line:| Message:
77|error: expected initializer before '.' token|
In function 'int main()':|
96|error: expected unqualified-id before '.' token|
97|error: expected unqualified-id before '.' token|
98|error: 'inbox' was not declared in this scope|
98|error: expected type-specifier before ')' token|
||=== Build finished: 5 errors, 0 warnings ===|
Line 77. Three problems. 1) Return type should be Email, not vector<string>.
2) Class name should be Mailbox, not Email.
3) Separator should be ::, not .
Email Mailbox::getmessage(int i)
Line 89: ) doesn't belong there.
Line 96. You can't use new that way. You have to declare an instance.
Email msg(sender, recipient, subject, text);
Line 97. Likewise. Mailbox is a class, not an instance.
Mailbox inbox;
Line 98: You have to pass an Email instance to addmessage.
inbox.addmessage (msg); // add the instance created on line 96.