answersLogoWhite

0


Best Answer

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

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you pass a class in programming cplusplus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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


What can Cplusplus do vs HTML?

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


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 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 good C plus plus websites?

You can learn from YouTube as that is the best way to go interactive. If you already know about programming and coding then you can go for websites with documentation and notes. The most intense in the Microsofts Developers Network. After that you can go for tutorialspoint or cplusplus (dot) com.