- Feb 17 Fri 2012 13:27
cpp - function template
- Feb 17 Fri 2012 13:08
cpp - Friend class
A friend class is a class that can access the private members of a class as though it were a member of that class.
we can define an entire class as a friend as follow :
- Feb 17 Fri 2012 11:45
cpp - Multiple inheritance
Multiple inheritance enables a derived class to inherit members from more than one parent.
- Feb 16 Thu 2012 22:05
cpp - inheritance
When one class inherits from another, the derived class inherits the variables and functions of the base class.
These variables and functions become part of the derived class.
- Feb 16 Thu 2012 21:58
cpp - Static member functions
Static member function means that we can be called directly by using the class name and the scope operator.
for example :
- Feb 16 Thu 2012 21:47
cpp - static member variables
Static member variable
Static member variable is similar to global variable , but it is applied to class.
- Feb 16 Thu 2012 21:36
cpp - operator overloading
Operator overloading allows the programmer to define how operators (such as +, -, ==, =, and !) should interact with various data types.
Because operators in C++ are implemented as functions, operator overloading works very analogously to function overloading.
- Feb 16 Thu 2012 13:43
cpp - constructor and destructor
Constructor:
Constructors are typically used to initialize member variables of the class to appropriate default values.
- Feb 16 Thu 2012 13:30
cpp - public and private
In the class , we can define public or private for its data member (or method).
The data member can only be used by method of class if we define the type of data member is public.
- Feb 16 Thu 2012 13:17
cpp - define Class
In C++, classes are very much like structs, except that classes provide much more power and flexibility.
In C++, when we declare a variable of a class, we call it instantiating the class. The variable itself is called an instance of the class. A variable of a class type is also called an object.
- Feb 16 Thu 2012 13:07
cpp - anonymous union
Union is like strucuture but it can only assign one member one time , and a anonymous union is a union without class name .
Anonymous can help us save memory space , because operation system would allocate the largest memory space of largest
- Feb 15 Wed 2012 23:14
cpp - #define for Constant and Marco
- Feb 15 Wed 2012 22:48
cpp - default parameter
- Feb 15 Wed 2012 10:27
Java - How many files in the directory
- Feb 14 Tue 2012 11:06
cpp - reference
Reference is a alias of a variable , it can be used to instead of pointer sometimes.
C++ references differ from pointers in several essential ways:
- Feb 14 Tue 2012 00:15
cpp - function overloading
Sometimes we may generate the functions which have the same function
but have different argument or return type.
- Feb 13 Mon 2012 17:12
cpp - operators
- Feb 13 Mon 2012 17:01
cpp - set the output width
- Feb 13 Mon 2012 16:08
cpp - cerr , cout , and redirect
cout, clog and cerr are pre-defined objects defined in ostream.
The iostream class inherits from both ostream and istream
- Feb 13 Mon 2012 16:03
c++ - Display octal and Hexadecimal
We can use the operator , dec , oct , and hex to decide which format we want.
for example: