115k views
2 votes
Define a pointer variable named daco that can be used for objects of the class Banana.

a)new int daco;

b)new Banana daco;

c)Banana * daco;

d)new Banana * daco;

User DHN
by
5.1k points

2 Answers

1 vote

Answer:

A

Step-by-step explanation:

it's new int daco;

User Nakhli
by
4.6k points
3 votes

Answer:

c)Banana * daco;

Step-by-step explanation:

To declare an variable pointer we use * symbol after writing it's type.For example int *.Then we write the name of the variable since the name of the variable is daco.The class is a user defined data type so instead of writing any data type we will write class name then the * then name of the variable.

Banana * daco; which matches the option c Banana* daco;

User Mukesh Lokare
by
5.5k points