Given the following class definition and the following member function header, which is the correct way to output the private data?
Class Person
{
Public:
Void outputPersonostream& out) ;
Private:
Int age;
Float weight;
Int id;
};
Void Person::outputPersonostream& out)
{
//what goes here?
}
A) out << person.age << person.weight << person.id;
B) out << person;
C) out << age << weight << id;
D) outputPersonperson) ;
Correct Answer:
Verified
Q29: C++11 allows you to have a constructor
Q30: When defining a class, the class should
Q31: Given the following strucure definition, what is
Q32: The name of a constructor is _
Q33: Which of the following is the correct
Q35: You specify an individual member of a
Q36: If class A is derived from class
Q37: C++11 allows you to directly set the
Q38: To assign values to a structure variable,
Q39: The constructor of a class that does
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents