Given the following simplified classes,

class Pet
{
public:
virtual void print();
string name;
private:
};

class Dog: public Pet
{
public:
void print();
string breed;
};

Dog vDog;
Pet vPet;
vDog.name="rover";
vDog.breed = "Collie";
Which of the following statements are not legal?
a. vPet=vDog; cout << vDog.name;
b. vPet=vDog; cout << vDog.breed;
c. vPet=vDog; cout << vPet.name;
d. vPet=vDog; cout << vPet.breed;

d. vPet=vDog; cout << vPet.breed;

Computer Science & Information Technology

You might also like to view...

You cannot undo updates or deletions performed by a(n) ________ query

Fill in the blank(s) with correct word

Computer Science & Information Technology

Which Cisco IOS command would be configured on the local interface of a router if the hosts on the network intend to get their IPv6 addresses from a non-local DHCP server with an address of 2001:db8::1234:9876?

A) ipv6 relay destination 2001:db8::1234:9876 B) ipv6 dhcp relay 2001:db8::1234:9876 C) ipv6 helper-address 2001:db8::1234:9876 D) ipv6 dhcp relay destination 2001:db8::1234:9876

Computer Science & Information Technology