Networking, Programming and Graphics Tutorials

Basic to class type - C++ [1/1]

Type:
Basic to class type - C++
Level: Intermediate Networking, Programming and Graphics Tutorials Networking, Programming and Graphics Tutorials 
Basic to class type - C++
Date: 2006-Dec-08
Basic to class type - C++
Visited: 1026 times
Basic to class type - C++
Rating: Basic to class type - C++
Basic to class type - C++
Author: Alex Plumpton

Means to Learn

Basic to class type conversion is easy to accomplish. Here, we can convert basic data typeto class type with the help of constructor functions.

Basic to class type

class time
{
int hour;
int minute;
public:
...
...
time(int min)
{
hour=min/60;
minute=min%60;
}
};


Conversion statements

time t

int ho 12
ho;

Let us consider an example of converting int type to class type. The following conversion statements can be used in the main function. Thus, the right hand side operand ho of basic type int has been cast to left hand side operand of type class object .

Means to Learn

Rate this tutorial:                    
Networking, Programming and Graphics Tutorials - Basic to class type - C++ [1/1] - Networking, Programming and Graphics 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++  Type Conversion Basic to Class  class to basic type conversion in C++  Tutorial C++ "Basic to class type" conversion  basic of type conversion in c++  c++ basic type conversion  class type C++  changetype in c++ int to class type  "class type Conversion"+C++  "class type tutorial" in c++  visual basic rdp  multimedia BASIC SHAPES  Basic video editing tutorials  change port in trillian basic  basic tutorials of function overloading  trillian basic single click  class C++  C++ class within a class  c++ arrays within a class