answersLogoWhite

0

A class is a type. You cannot pass a type in C++, you can only pass an object of the type, either by value or by reference.

The only way to physically pass a type is to pass a void pointer (void*), then use expensive runtime type information to determine the runtime type of the object being referred to. However, it's much more efficient (and easier) to simply pass a base class that provides the generic (virtual) interface required by your function.

User Avatar

Wiki User

10y ago

What else can I help you with?

Related Questions

A function and a class which is preferred and which is legal in cplusplus programming language?

you


Where could you learn the programming language Cplusplus on the internet for free?

There are a number of websites that can teach C++ programming for no cost. Please see the related links for some sites.


What is constructor in cplusplus?

A constructor is a special member function which have same name as the class name.`


Elements of assembly language programming What is A simple assembly scheme pass structure of assembler design of two pass assemblers a single pass assemblers what is macros?

what are the elements of assembly language programming?


Where can you find a tutor for Programming I class?

At school


Maria wants to become a computer programmer. What SMART short-term goal could she set for herself?

to enroll in a semester-long class about programming languages and pass with a GPA of 3.0


What class had to pass through Ellis Island?

What class had to pass threw Ellis Island


What can Cplusplus do vs HTML?

C++ can be used to make programs, HTML is for weblayouts and whatnot.


What is an easy way to learn computer programming?

Attend a class on it


What is need of object in object oriented programming?

Object is an instant of the class, by using an object we can members of the class.


How can we make sure (pragmatically) that a class will have no further child classes. Which programming stmt will do this in Java and C?

How can we make sure (pragmatically) that a class will have no further child classes. Which programming stmt will do this in Java and C++?


What are the key differences between a parent class and a grandparent class in object-oriented programming?

In object-oriented programming, a parent class is a class that is extended by another class, known as a child class. A grandparent class, on the other hand, is a class that is higher up in the inheritance hierarchy and is not directly extended by the child class. The key difference is that a parent class is directly related to the child class, while a grandparent class is further up the inheritance chain.