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”
Initialization of variables/objects in C++ can often be a reason for confusion.Continue reading “C++ – Initialization”
This is my second article on multi-threaded programming. I highly recommend you to read the previous article 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. It is important to know their distinction and how multi-threading can facilitate their implementation.
‘const’ keyword is a type qualifier that can be associated with an object. It tells the compiler to mark the object as read-only.
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”
Lambdas or Lambda Expressions were introduced into the standard in C++11.
Continue reading “C++ – Lambdas”
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.
Continue reading “C++ – Memory Alignment”
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”
Typecasting in C++ allows us to perform conversion between types.
Continue reading “C++ – Type Casting”
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”
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”
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()”
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’”
A constructor is a special member function that is automatically called when you create an instance of a class. Continue reading “C++ – Constructor”
The idea of inheritance implements an IS-A relationship between classes.
Continue reading “C++ – Inheritance”
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”
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’”
A name in C++ has three main properties, Duration, Scope, and Linkage.
Continue reading “C++ – Duration, Scope, and Linkage”
One Definition Rule or ODR is an important rule in C++ which loosely states the following.
Continue reading “C++ – One Definition Rule”
People discuss shallow copy and deep copy in the context of classes.
Continue reading “C++ – Deep Copy vs Shallow Copy”