C++ Programming Tutorials

C++ Programming Tutorials And Articles
  Title Reverse Sort Order / Author Replies
Views
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
15,033
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
129,092
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,434
C++ standard library is a set of user defined types(classes), objects and functions which help to develop applications. Without standard library it is very very difficult to write a useful application. Standard library is an integrated part of the language and the language specification defines the...
0
465
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,746
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
27,182
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
627
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
748
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
745
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
744
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
808
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
836
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
548
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
528
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
659
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,780
Objects vs Closures Closures might not be a familiar term for most of the C++ programmers. C++ programmers are very much familiar with class, object and function. Instances of classes are first-class objects in C++ but functions are not first-class entity in C++. An object or function to be...
0
513
We have discussed about inbuilt data types and inbuilt operators which operate on inbuilt data types only. We also discussed about user defined data types. Don’t you think that the operators should work for user defined data types also. You know that we cannot create new operators or change the...
0
378
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,713
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
362