C++ Programming Tutorials

C++ Programming Tutorials And Articles
  Title Reverse Sort Order / Author Replies
Views
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. ...
8
127,154
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...
1
36,350
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
16,678
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
26,728
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...
0
563
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?...
0
642
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...
0
671
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...
0
670
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...
0
740
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...
0
787
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...
0
452
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...
0
457
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...
0
544
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...
0
2,743
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...
2
3,676
In previous chapter we came to know about data types. There are data types defined by the language called in-built data types. C++ also allows to create new data types. In this chapter we will concentrate only on in-built data types. We will discuss user defined data types later. C++ basically...
0
207
Basically computer programming is all about data and manipulation of data. The manipulation is called operation and operations are accomplished with the help of functions and operators. Like functions work with data, operators also work with data. The difference between functions and operators are...
0
213
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...
0
633
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
28,128
In the previous chapter we saw how to compile a C++ source code in a single file. The extension of the source code file name should be .cpp (*.cpp). We also included other files inside the cpp file. While we can include any text file with any name but the standard is to include header files which...
0
248