C++ Programming Tutorials

C++ Programming Tutorials And Articles
  Title / Author Replies
Views
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
182
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
186
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
418
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
480
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
533
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
579
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
470
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
383
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
316
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
441
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
368
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
344
Before we go into the details of C++ templates let us take an example of function overloading. I am assuming you know what is function overloading. #include<iostream> using namespace std; int larger(int n1, int n2) { cout << "int larger(int, int) is called" << endl; return n1 > n2...
0
470
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
667
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
600
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
541
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
504
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
553
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
534
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
754