I want to have a nonmember function to have access to the private members of a class. The class must declare that function a

a) friend
b) inline
c) static
d) None of the above nonmember functions cannot have the access described here.


a) friend

If a class declares a functions to be a friend, it is granting access to the
private members (it already has access to the public members.)

Computer Science & Information Technology

You might also like to view...

For each function, f(), g() and h() state how what exceptions should be thrown.

Given these three functions with different exception specifications What will be an ideal response? a) void f()throw(); b) void g()throw(int, string); c) void h();

Computer Science & Information Technology

Where is BGP used?

What will be an ideal response?

Computer Science & Information Technology

Explain carefully how component-based middleware in general and EJB in particular can overcome the key limitations of distributed object middleware. Provide examples to illustrate your answer.

What will be an ideal response?

Computer Science & Information Technology

When clicked, a ________ will take you to another location in the worksheet, another file location, a Web page on the Internet, or to your organization's intranet

A) hyperlink B) Save As dialog box C) page break D) welcome screen

Computer Science & Information Technology