C++ Programming Tutorials

C++ Programming Tutorials And Articles
  Title / Author 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
159
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
167
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
154
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
252
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
231
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
255
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
348
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
556
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
526
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
403
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
396
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
455
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
462
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
653
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
676
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
638
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
629
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
789
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
686
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
746