![]() |
||||||||||||||||||||
|
"exact phrase" include -exclude
will give you more specific results |
Class to class type in C++ [1/1]
There are situations, where we would like to convert an object of one class to an object of another. These conversions can be done either using casting operator function or constructor functions. The general form of conversion from one object to another is as shown above. Here the obj1 is an object of a class, say class A and obj2. an object of class B. Then class A is referred to as the destination class and the class B, the source class. In the conversion statement using the casting operator function operator typename(), type name specifies the destination class and this conversion takes place inside the source class, which needs to be type cast. This implies that the source class will be type cast to destination class type.
|
RECOMMENDED TUTORIALS
Need a specific tutorial? Do not hesitate and submit a request! |
||||||||||||||||||
| Related Tags: basic data type to class type conversion in c++ type conversion of basic to class type in C++ class type C++ Tutorial C++ "Basic to class type" conversion class C++ C++ class within a class c++ arrays within a class arrays within a class array within a class C++ "arrays in class" c++ class abstraction "c++" class hierarchy c++ example what is the sream class in c++ c++ stream class stream class in c++ "arrays within a class" webcam class for C++ nurbs class c++ "class declaration in c++" stream class in c++ | ||||||||||||||||||||
|
Home | Sitemap |
Terms & Privacy
© ONLINEHOWTO.net 2006 - 2008 |
||||||||||||||||||||