Given the following class definition and the following member function header, which is the correct way to output the private data? class Pe
class Person
{
public:
void outputPerson(ostream& out);
private:
int age;
float weight;
int id;
};
void Person::outputPerson(ostream& out)
{
//what goes here?
}
a. out << person.age << person.weight << person.id;
b. out << person;
c. out << age << weight << id;
d. outputPerson(person);
c. out << age << weight << id;
Computer Science & Information Technology
You might also like to view...
Sounds:
a. Are expected by players b. Are used in the background c. Are used when something happens d. All of the above e. None of the above
Computer Science & Information Technology
?What construct is intended for use in processing a list of objects, such as files, directories, users, printers, and so on?
A. ?for B. ?while C. ?case D. ?switch
Computer Science & Information Technology