I wonder what is the field out use for instructors comment


Here is a struct clarification:

struct Target {

std::ostream &out;

std:: string name;

Target(const std::string &name, std ::ostream &out = std::cout;

bool isLeaf() const;
....
};

I wonder what is the field "out" use for? Instructors comment it "// stream where Target will prints its output". Target is not a function, how can it has a output? I also confused about "std::ostream &out = std::cout", don't understand what is it doing.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: I wonder what is the field out use for instructors comment
Reference No:- TGS01481295

Now Priced at $10 (50% Discount)

Recommended (93%)

Rated (4.5/5)