Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
C++ Tutorial
Class 181 codes
Home
C++ Tutorial
Class
1 A friend function
2 A function can be a member of one class and a friend of another
3 A multilevel hierarchy
4 A parameterized constructor
5 A pure virtual function
6 A simple class hierarchy
7 A simple constructor and destructor
8 A static member functions
9 A virtual function
10 Access base classs virtual if derived class does not redefine it
11 Access member of base and use member of derived class
12 Access private data through accessor functions
13 Accessing members of objects on the heap
14 Accessor functions
15 Add a constructor to Base class
16 Add a constructor to derived class
17 Add a overloaded constructor to base class
18 Allocate an array of objects using new operator
19 Allocates and frees an object and an array of objects of type loc
20 An array of objects
21 An array of pointers to objects
22 An array on the heap
23 An example of multiple base classes
24 Assign class object
25 Assign value to member variable directly from assignment
26 Automatic inline functions
27 Automatically converted into MyClass(4)
28 Base-Class Access Control
29 Call base virtual function explicitly
30 Call bases constructor and destructor from derived class
31 Call bases default constructor automatically
32 Call class constructor or not during class array declaration
33 Call class constructor without new operator
34 Call constructor from base class
35 Call constructor from base class to initialize fields inherited from base class
36 Call default constructor when allocating an array dynamically
37 Calling base method from overridden method
38 Cascading member function calls with the this pointer
39 Class objects can be assigned to each other using default memberwise assignment
40 Class prototype
41 Class with only virtual methods
42 Classes example
43 Close stream in destructor
44 Constructor as conversion operator
45 Constructor parameter with default value
46 Containership with employees and degrees
47 Copy constructors
48 Create a getter for member variable
49 Create an array of objects
50 Create an object from a Class and call its function
51 Creates two objects
52 Creating objects on the heap using new
53 Declare a class with method
54 Default values in member functions
55 Define a class with a member function that takes a parameter
56 Define class to record time
57 Define class with a data member and member functions to set and get its value
58 Define inner class
59 Define your first class
60 Defines constructor, destructor, and range() function in-line
61 Defining and using a default class constructor
62 Delete an array of objects
63 Demonstrate protected members
64 Demonstrate public inheritance
65 Demonstrating composition--an object with member objects
66 Demonstrating the const_cast operator
67 Demonstrating the order in which constructors and destructors are called
68 Deriving Abstract Classes from Other Abstract Classes
69 Deriving ADTs from other ADTs
70 Dynamic_cast
71 Dynamic_cast between base class and subclass
72 Dynamic_cast from derived to base
73 Friend Classes
74 Friend functions and operator overloading
75 Friend functions can access private members of a class
76 Friend functions can be shared by two or more classes
77 Friend square() function for Distance
78 Granting Access
79 Hiding methods
80 How to use an access declaration
81 If a constructor only has one parameter
82 Implement class member function
83 Implementing pure virtual functions
84 In cases of multiple inheritance
85 Increment counter variable with ++ operator
86 Incrementing and decrementing an object pointer
87 Inherit base as private
88 Inherit base as protected
89 Inherit base class twice
90 Inherit protected fields
91 Inheritance and protected Members
92 Inherited as public
93 Initialize an array of objects by referencing the constructor directly
94 Initialize an array of objects without referencing the constructor directly
95 Initialize inner object using initialization syntax
96 Initialize member variable
97 Initialize member variable in constructor
98 Initialize numA and numB inside the MyClass constructor using normal syntax
99 Initialize parameters in base class
100 Initialize the public data members in a class
101 Initialize variables and conduct calculation in constructor
102 Initialize variables from base class using initialization syntax
103 Inline function definiton
104 Inline functions
105 Inline method
106 Inner class
107 Instantiating multiple objects of the class using its constructor
108 Local Classes
109 Member function overloading
110 Multiple base class constructing and destructing
111 Multiple Inheritance in both private and public way
112 Multiple Inheritance to have the features from both parent
113 Multiple inheritance example
114 Multiple inheritance with employees and degrees
115 Multiple inheritance with English Distances
116 Multiple virtual member functions called in turn
117 MyClass ob = MyClass(4)
118 MyClass ob(4)
119 Name conflicts
120 Non-friendnon-member functions cannot access private data of a class
121 Normal functions accessed from pointer
122 Object array of derived classes
123 Object assignment
124 Output variable initialization message
125 Overload across class hiearchy
126 Overload constructor
127 Overload constructor for different data format
128 Overload constructor two ways
129 Overload the constructor
130 Overloading class member functions
131 Overloading functions in base and derived classes
132 Overloading two class member functions
133 Overriding a base class method in a derived class
134 Pass parameter to two base classes
135 Passing References to Objects
136 Pointers as data members
137 Pointers to Class Members
138 Private by default
139 Private fields
140 Protected Base-Class Inheritance
141 Protected fields
142 Public fields and member functions
143 Refer to static variable through its class name
144 Reference another class in member function
145 Resolving Ambiguity in Case of Multiple Inheritance Involving Common Base Classes
146 Returning the dereferenced this pointer
147 Shadow base class function in its two children classes
148 Shadow function with the same name in base class
149 Share friend function between classes
150 Share static variable among different class instances
151 Sort person objects using array of pointers
152 Static data members
153 Static method and static variable
154 Static_cast operator
155 The class member access operators and -
156 The default constructor for class X is one that takes no arguments
157 Three level inheritance
158 To use a pointer to the object, you need to use the - operator
159 Use & to get object address
160 Use a static instance variable
161 Use class as a member field
162 Use class as the member function parameter type
163 Use class pointer and class array together
164 Use constructor to initialize class fields
165 Use friend operator functions
166 Use new to allocate memory for a class pointer
167 Use the this pointer
168 Use typeid to test type equality
169 Use virtual function to calculate area for different shapes
170 Use virtual functions and polymorphism
171 Use Virtual Functions to change the method behaviour
172 Using a class with private data members
173 Using an empty initializer
174 Using an inline function to calculate the volume of a cube
175 Using the this pointer
176 Using virtual base classes
177 Using virtual methods
178 Virtual base classes
179 Virtual copy constructor
180 Virtual destructor methods
181 Why Virtual Functions