Suppose this is embedded in an otherwise correct and complete program. Which version of f() will be called?
Suppose class D is derived from class B, and class B has a public member function whose declaration is void f();. Suppose class D has its version of the function, void f(). Here is a pointer definition and an access to a member function..
```
B* bPtr = new D;
BPtr->f();
```
a) D::f()
b) B::f()
c) This is illegal. You can’t assign a D object to a variable of type pointer to B.
b) B::f()
When the functions are not virtual, and access is made through a pointer or a reference (here a pointer) the function called follows the type of the pointer.
You might also like to view...
Explain the role of port numbers in TCP and UDP.
What will be an ideal response?
Round the values down at the places noted.
16.9 at units place
Identify the letter of the choice that best matches the phrase or definition.
A. The process of organizing, storing, and saving old documents. B. Any person or company in your Address Book. C. Mail that uses a computer network to send and receive messages. D. Electronic junk mail. E. Specific criteria to search on.
The way a network is configured is called the _____.
A. network orientation B. network baseline C. network topology D. network index