C++ Programming Tutorials

C++ Programming Tutorials And Articles
  Title / Author Reverse Sort Order Replies
It's a truly neutral question: given that there are many languages to choose from, why do you choose to program in C++? 1. Compared to many of the other OO languages (i.e. Java, C# etc.), C++ has better support for the functional programming style. 2. Good support for generic programming. ...
Three major concepts of C++ are Classes, Polymorphism, Inheritance.Let us discuss them in details. Classes A class is the implementation of an abstract data type. It defines attributes and methods which implement the data structure and operations of the abstract data type, respectively....
Introduction To Binary Trees A binary tree is made of nodes, where each node contains a "left" pointer, a "right" pointer, and a data element. The "root" pointer points to the topmost node in the tree. The left and right pointers recursively point to smaller "subtrees" on either side. A null...
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...
Many of us might have wondered at sometime or the other about how to pass a variable number of arguments to C++ functions : something like a printf function. I don't know how many are aware of this, so I decided to post an article on this topic. Background When a function is declared, the...
Introduction Many times you may have wondered how to return several values from a C++ function. I know it's easy for most of you when you know "how many" values your func is going to return. I have seen many people use std::pair to return two values from a func. But what about the case when you...
A Simple program for implementing Linked Stack #include<stdio.h> #include<stdlib.h> #include<conio.h> struct node { int data;
Data Structures operations using STL(Standard Template Library) #include<iostream> #include<vector> #include<algorithm>// Included for Algorithmic functions such as sort,max_element,binary_search etc #include<stdlib.h> using namespace std; void main() { int i,number,array,choice,srch;...
Virtual Destructor Virtual Destructor is used to release the derived class objects in a proper order.... Consider an Example: #include<iostream.h> class Base
When you compile the following code in VS 6 you get the output as #include <iostream.h> #include <stdio.h> void main() { cout<<"hello"; printf("hi"); } hihello
You can add words to be highlighted in the IDE of Visual Studio 6, 2003 and 2005. Steps (From MSDN) In the same directory as msdev.exe (for Visual Studio .Net search for ...\Microsoft Visual Studio.NET\Common7\IDE\devenv.exe), use the Text editor or Windows Notepad to create a text-only...
Introduction - What is priority Queue A priority queue is an abstract data type (ADT) supporting the following three operations: 1. Add an element to the queue with an associated priority 2. Remove the element from the queue that has the highest priority, and return it 3. (optionally)...
Introduction A C++ class with lots and lots of comment on each line for you to understand what each line does and how the program flow works. The Code #include <iostream> // Included for cout
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 {...
Sort the content of a linked list. Note: I had a major bug pointed out by RiOrius and is rectified now. Thanks for letting me know about it. #include <iostream> using namespace std; #define NULL 0
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 ...
Background I happen to manage many sites this days and so at times I need to upload lots of things to my servers and when uploading from windows PC to Linux servers the biggest problem that comes up is the case sensitive issues and so I tried googling it but what I found are some cool utilities...
The misconception that C++ is an advance C still prevails among developers and so let me try to clarify that C++ only inherits some syntax from C and nothing more than that. Before I get into the details about the difference between C and C++ programming let me clarify a myth, which is, you need to...
1) This Simple program explain one of the use of this pointer in C++. 2) With the help of "this" pointer you can call as many as functions in a sequence. 3) This procedure is called function chaining 4) In this program i have used three different function and through main i have called all...
This simple program explain you about how to use BitMap in Turbo C++. NOTE :Before Running this program you have to copy one file in your "bgi" directory. That file either you have to download from the net or i will provide you. The file name is "SVGA256.BGI". Copy this file at your " tc\bgi\...