Hi! I'm currently trying to make a small program that uses classes to simulate an email client. Meaning that it has the ability to record the 'to', 'from', 'subject', and 'message' fields. I've created the Message class, and used a constructor to take the initial 'to' and 'from' fields. I've also made a member function that ask for the subject and message from the user. All of the variables are strings stored in the public section of the class, but after the values are inputted, they don't all display when I try to print them out.
For example, the 'to' and 'from' are inputted with the creation of a new instance of the class. So it's likeI'm pretty sure that I'm either using the member functions incorrectly (they're all void except for the constructor), or maybe just in passing the string variables - so any help would be greatly appreciated. Even if it's just pointing me in the right direction. Thanks!!Code:int main() { message newMessage (t,f); // t&f being 'to' and 'from' newMessage.append(); // asks for the subject and msg body newMessage.print(); // prints out the message }
Jim



LinkBack URL
About LinkBacks


