C++ Programming Tutorials

C++ Programming Tutorials And Articles
  Title / Author Replies
Views Reverse Sort Order
Memory pools allow dynamic memory allocation comparable to malloc or the Operator new in C++. As those implementations suffer from fragmentation because of variable block sizes, it can be impossible to use them in a real time system due to performance. A more efficient solution is preallocating a...
6
26,549
Just thought of having a simple example which has everything you need to know about the basics of C++. It has Inheritance, polymorphism, operator overloading, templates using friend as well as non-friend functions. #include <iostream> using namespace std; template <typename T> class Base {...
12
26,288
This is very simple if you think in a simple manner. A magic square is represented in a matrix form. May be all of you know this formula to satisfy magic square rule i.e. for size of matrix n*n sum of each row or column or diagonal should be n/2. means for n=3 , sum(row or column or diag)...
34
20,266
Definition : Class which Can't be inherited by other class, that class is called final class. You all knows that final class is inbuilt in java. But in C++ you have to create final class.Two types of Final class, you can create . One who want to create object of final class on Heap and other who...
6
19,963
Steps to integrate code into your programs This is an easy and flexible way to use bitmaps as buttons in your application, and here are the detail steps of how you can add the custom button to your application. Create a new MFC AppWizard (exe) based project and name it as BtnSample ...
21
18,161
Generics are parameterized types supported by the common language runtime. A parameterized type is a type that is defined with an unknown type parameter that is specified when the generic is used. C++ supports templates and both templates and generics support parameterized types to create typed...
1
17,098
I thought of starting the whole algorithm series with the most popular Sorting algorithms. Sorting as you know is a way to order a list or a sequence or elements. ex: Arranging set of marks to ascending order Arranging names to alphabetical order Why learn Sorting when sort() is readily...
5
16,448
Complete Binary tree program done in C++ including Inorder, Preorder and Postorder Traversal. #include <iostream.h> #include <stdlib.h> enum {TRUE = 1,FALSE = 0}; typedef struct _node {
2
15,534
Inheritance is a feature in object-oriented programming which is very similar to the way we inherit characteristics from our parents. Characteristics in object-oriented programming terms are attributes and behaviors of a class—that is, the data and methods of a class. Inheritance is a...
4
14,157
Had to have some days break off . So, lets move on, this time a little than practicals, but again these are more than important in solving the problems in the real world. As I said that will explain more about the different types of the data structures while we move on, here I'll explain 3 of the...
3
13,607
Introduction This article talks about Initialization List in C++. Background Definition: Initialization List is another or a better approach for initializing the member variables (and base class objects) of a class upon construction of an instance of it's own.
6
13,531
Introduction Code for solving system of equation by Gaussian elimination method. The Code is well commented and would not need any further explanation The code #include <stdio.h> #include <conio.h> #define N 100
10
13,390
Introduction This article talks about ASSERTs usage and customizing our own ASSERTs. Background Asserts are to catch implementation errors. The developer can document all the assumptions made on the his/her program, by using ASSERTs. If you have used asserts in your code and if it...
8
13,387
Casts are used to convert the type of an object, expression, function argument, or return value to that of another type. Some conversions are performed automatically by the compiler without intervention by the programmer. These conversions are called implicit conversions. The standard C++...
5
12,706
Polymorphism is in short the ability to call different functions by just using one type of function call. It is a lot useful since it can group classes and their functions together. It is the most important part of Object-Oriented Programming. Polymorphism is the core of object-oriented programming...
1
12,641
Introduction This article talks about Handle-Body pattern and it's uses. Background Though, C++ provides private and public access specifiers to differntiate implementation and interface parts of a class, down the line any changes to the private data or member functions implementation...
6
12,593
The Input/Output system in C++, holds information about the result of every I/O operation. The current status is kept in an object from type io_state, which is an enumerated type (just like open_mode) that has the following values: godbit -> No errors. eofbit -> End of file has been reached...
2
11,659
Introduction This article talks about how Virtual table and _vptr looks in case of simple Multiple Inheritance Background In Multiple Inheritance, the Derived class contains the _vptr of all it's Base classes. Lets see the below example, where-in, derived class i.e. Derive is derived...
1
11,071
When exceptions occur, the programmer has to decide a strategy according to which he would handle the exceptions. The strategies could be, displaying the error messages on the screen, or displaying a dialog box in case of a GUI environment, or requesting the user to supply better or simply...
1
10,989
This program shows how to create the private constructor in C++. #include<iostream.h> #include<conio.h> class Test { int Data; //Stores the Data
3
10,655