C++ Programming Tutorials

C++ Programming Tutorials And Articles
  Title Reverse Sort Order / Author Replies
This article talks about Association, Aggregation and Composition Relationships between classes with some C++ examples. Background Association is a simple structural connection or channel between classes and is a relationship where all objects have their own lifecycle and there is no owner. ...
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...
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 {
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...
C is not a strong type based language but C++ has been trying to become a stronger type based language. Classes and structures are example of strong types whereas the implicit conversion between different types is an example of weak type system. For example, in the following decelerations implicit...
nullptr A C++ programmer frequently come across pointer variables, pointer arguments to function and pointer template arguments. Let us take different cases to see how C++98 handles the situation where a pointer is set to nothing. When we write void *p = 0; or void *p = NULL; What do we do?...
C++ has a lot of way of initializing an object but prior to C++11 there was no single way of initialization applicable to all type of objects. That was the motivation to find a single way of initialization in C++11. Novice programmers may get confused with initialization and assignment...
In C++ we already know different uses of the ellipsis operator (…) in different context. It is used for functions with variable number of argument, variadic macros and in catch block in exception handling. Let us look into these existing meaning of ellipsis operator (…) in different context and...
When the name of something or some person is big and we are bored to call the same long name again and again we try to find a short name easy to call in place of original name. This is like a nickname. In C++11 programming, we use aliasing to create shorter type name for an existing longer type...
Concurrency in applications is the ability of the application to have more than one independent execution path and still work for the common goal. This implies that the independent execution paths need to communicate with each other while getting executed. Here for the simplicity of the discussion...
Invoking copy constructor in C++ has always been problematic, specially when the copy operation is expensive. While passing parameter by value and the invocation of copy constructor can impose huge performance penalty specially when temporary objects are created, copied to another object and the...
Objective of a programming language is to make the life of programmers easy. Human programmers do mistakes while writing code. While writing code you might be writing something different from what is in your mind. This can be due to typos, absent mindedness, misunderstanding the language syntax or...
C++11 has introduced a lot of of features to make programming easier. For example automatic type deduction and less typing. Range based for loop and std::for_each() functions are among those. They are new techniques for iterating through the elements of a sequence container, like vector, arrays or...
After a long wait C++Builder XE3 Update 1 has finally acquired the capability of building 64-bit applications. It means that developers using this tool will soon face the yet unfamiliar world of 64-bit errors. What is a 64-bit error? This is just a common error in a program. But it has one...
C++ FAQ's I've spent the past few weeks learning C++, and here are a bunch of FAQ's I came up with. Some of these Q n A's are from various sources, but I have edited and revised them using my own words. What is C++? C++ is a computer programming language. Its name is literally...
The words Initialization List indicates that it is related to initializing something. What is to be initialized? Ok, when memory is allocated for any object of any type (primitive or user defined) the content of the memory can be undefined or set to some standard value (preferably zero) specific to...
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...
In C-Style typecasting we discussed about type casting and why is it required and how it is used in C programming. C++ has more types of typecasting and an entirely different way to use them. A point to be noted that C++ typecasting would be mostly described and used in context of classes, as...
Not so experienced developers of Windows applications like me, always get confused in the first place when they think about the implementation of multi-threading. Not you? You might be expert though. My objective is to help novice programmers and the guys who don’t claim to be expert but do...
Here i am going to show you some basic C++ Programming... If you have any questions just ask. :) #include <cstdlib> // This must be used if you are going to be a MS-DOS Application. #include <iostream> // This must be included in the header file if you are going to use "Cout" and "Cin"...