Hi, I am practicing creating classes, and everything that goes with it, as well as assigning objects to other objects. I wanted to try and assign one object of the same type to another object that was created but with a different constructor, to see if that was possible/allowed. But when i create this object in the main function, it does not show as a local variable (when i mouse over it) like the other objects I have created. I am unsure why this is, I do not know if it has something to do with the constructors? Or if for some reason I just cannot create objects the way I am creating. I have pasted my code below, if anyone could help, I would appreciate. The problem object is copyBen.
This builds on what you had but shows how bob, ben etc are Student objects and how to use the class methods using dot notation.
If you decide to extend the Student member list to name, ID credits etc then have a string for the Student objects name, so object 'bob' could have a name "Mary-Anne" for instance, or Student object 'anyone' could be intialized with "Bob" as a name.
The expression credits>= 200 is of type bool, so you can return it directly. You could also write the statement without the parentheses (return credits >= 200;) but I find the parens clearer.