C++ Programming Tutorials

C++ Programming Tutorials And Articles
  Title / Author Replies
Views
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
303
In the earlier chapters we discussed that we write programs in human readable text and then the compiler converts it to machine readable format so that the CPU can execute the program. Now I will give an overview of the compilation process. It is not mandatory to know how compilers compile your...
0
295
In the first chapter we have seen what are the minimum elements a program should have. In this chapter we will learn to create those basic elements and give the shape of a basic program which can be compiled using C++ compiler. You can create a program which will silently do some task but you will...
0
249
C++ is a programming language which has evolved from it’s ancestor C language. Bjarne Stroustrup is the creator of the C++ language. Before C++ language got proper shape the creator has created it’s previous version called ‘C with Classes’ in the duration of 1979 to 1983. It was actually a...
0
239
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
365
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
403
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
582
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
629
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
600
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...
0
591
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
759
In C++ we have two types of functions: stand alone function and member function(non-static). After the compilation both are just function. Difference between a class member function and a standalone function is that the class data is bound to the member function but no external data can be bound to...
0
660
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
710
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
522
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
615
We know that C++11 added the feature of rvalue reference. Here assumption is that the reader is already familiar with rvalue and lvalue and their references. As we know that we declare rvalue reference with double ampersand like: int&& var1 = 10; // var1 is an rvalue reference variable means it...
0
729
C++ always has been creating fast programs, still there were loop holes which could substantially slow down C++ programs until C++11. This was due to temporary object creation and expensive object copies. C++11 added a new reference type called 'rvalue reference' and a new concept of moving object...
0
706
Releasing memory allocated in heap has been always been a concern for programming languages like C and C++. Memory leak is a side effect of using dynamic memory allocation in C++. This is because C++ compiler does not support automatically release memory allocated in heap when they are no more...
0
716
To understand usage of auto and decltype keyword you need to know the existing type deduction facility available in C++98, because auto and decltype are C++11/C++14 extension to the existing feature of the compiler to deduce type from another expression. In case you are not aware of existing type...
0
708
Many experienced programmers have ignored the fact that the major release C++11 has added lot of features which are part of modern programming technique. If you are passionate programmer and loves C++ as the programming language you must know those new features. The objective of this topic is to...
0
833