It is important to know the distinction between an l-value and an r-value if you are to be a serious C++ programmer. This article is intended to provide a basic understanding of their differences.Continue reading “C++ – Understanding lvalues and rvalues”
C++ – Initialization
Initialization of variables/objects in C++ can often be a reason for confusion.Continue reading “C++ – Initialization”
C ++ – Multi-threaded Programming 2
This is my second article on multi-threaded programming. I highly recommend you to read Multi-threaded Programming 1 before proceeding any further.
Concurrent programming, Parallel programming and Asynchronous programming are often spoken about in the same breath. However they aren’t necessarily similar.
‘const’ keyword is a type qualifier that can be associated with an object. It tells the compiler to mark the object as read-only.
C++ – Templates
Templates allow us to write generic classes (called template classes) and generic functions(called template functions) that can work with generic data-types.
Continue reading “C++ – Templates”
C++ – Lambdas
Lambdas or Lambda Expressions were introduced into the standard in C++11.
Continue reading “C++ – Lambdas”
C++ – Memory Alignment
I was once asked in an interview about the importance of memory alignment. I had absolutely no clue as to what it meant or why it was important in high performance/low latency programming.
LifeCycle of a program – A C++ Perspective
If you have ever wondered how a program written in C++ or any other language finally gets executed on the hardware and gives us the intended results,this is the article for you. This article will give you a high level overview of what happens behind the scenes.
Continue reading “LifeCycle of a program – A C++ Perspective”
C++ – Type Casting
Typecasting in C++ allows us to perform conversion between types.
Continue reading “C++ – Type Casting”
C++ – Smart Pointers
In C++, memory allocated from heap has to be freed manually. But there could be situations where the programmer forgets to deallocate the memory and causes what is known as memory leakage.
Continue reading “C++ – Smart Pointers”
C++ – Polymorphism
Polymorphism is the ability of an object to exhibit multiple behaviors. C++ allows two types of polymorphism, Static and Dynamic. Static polymorphism happens at compile time via function overloading whereas Dynamic polymorphism is exhibited at run time via function overriding.
Continue reading “C++ – Polymorphism”
C++ – Be wary of strcat() and strcpy()
strcat() and strcpy() are two functions that work with the c-style strings. While the former concatenates two strings, the latter copies one string into the other. Both these functions have been the reason for multitude of bugs in many applications. Although, they are simple functions to use, most programmers are oblivious to their implementation details which has resulted in quirky and hard-to-debug behaviors in several applications .
Continue reading “C++ – Be wary of strcat() and strcpy()”
C++ – ‘Friend’
A class or a function can be made a friend of another class in C++. A friend gets access to all the private members and protected members of the class to which it becomes a friend.
Continue reading “C++ – ‘Friend’”
C++ – Constructor
A constructor is a special member function that is automatically called when you create an instance of a class. Continue reading “C++ – Constructor”
C++ – Inheritance
The idea of inheritance implements an IS-A relationship between classes.
Continue reading “C++ – Inheritance”
C++ – Virtual Functions
When a class inherits from another class, it is possible to override the public methods of the base-class in the derived-class.
Continue reading “C++ – Virtual Functions”
C++ – Mastering ‘Static’
Static keyword in C++ can often be a cause of confusion for many people because of its varied use cases. If you are one of them, hope this article helps you alleviate it.
Continue reading “C++ – Mastering ‘Static’”
C++ – Duration, Scope, and Linkage
A name in C++ has three main properties, Duration, Scope, and Linkage.
Continue reading “C++ – Duration, Scope, and Linkage”
C++ – One Definition Rule
One Definition Rule or ODR is an important rule in C++ which loosely states the following.
Continue reading “C++ – One Definition Rule”
C++ – Deep Copy vs Shallow Copy
People discuss shallow copy and deep copy in the context of classes.
Continue reading “C++ – Deep Copy vs Shallow Copy”