C++ Programming Tutorials

C++ Programming Tutorials And Articles
  Title / Author Reverse Sort Order Replies
Views
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
515
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
430
We learned that all the variables have type. We also learned that type specify the memory size required to store the variable data and the interpretation of the data. So far we discussed about predefined (in-built) data types which are specified in the language specification. We use language...
0
351
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
979
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
895
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
791
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
830
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
834
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
763
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
786
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
796
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
583
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
384
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
457
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
522
As the name suggests STL is the part of the C++ standard library which provides a rich set of template classes and template functions to make application development faster. It is a software library, a very important part of the standard library and influenced other parts of the standard library....
0
677
All container classes are part of std name space. Most of the member functions of container classes are common and have common functionality. The decision of which container to use for specif need does not generally depend on the functionality of a container but the efficiency of some of it’s...
0
711
C++ program is a collection of statements. Normal statements are sequential and executed sequentially. These statements can be: Declaration Statements, or Expression statements. Also a group of statement treated as a single statement is called compound statement or block. Declaration Statements...
0
681
Iterator is a concept of objects which can be used to traverse through the elements of a collection of objects like STL containers. An iterator object can point to an element within a range of elements and provides a mean to move the pointer through other elements within that range using operators....
0
517
STL includes a set of template classes that overload the function call operator (operator ()). Instances of those classes are called functors or function objects. Many algorithm functions in STL take those functors as input and apply them on the elements they operate. STL has two kinds of function...
0
625