Static Members of a C++ Class

The class members are by default non-static. That means we can access them in the context of an object only. Each object will have its own copy of the data members. Even though the code segment is common for all objects of a class, the member functions can be called in the context of an … Continue reading “Static Members of a C++ Class”

C++ Classes and Objects

Supporting Object Oriented Programming (OOP) was one of the main reasons C++ was originally created as an extension of C. Object Oriented Programming is a software design paradigm around the objects and classes. Objects are the instances of classes. Classes are kind of blueprints for the objects that define what type of data or functionality … Continue reading “C++ Classes and Objects”

C++ | Binding a Member Function

In this article, we saw how to bind a function with parameters and placeholders and some of its benefits. There we used a normal function. Here will see how to bind member function of a class. Binding a Static Member Function Binding a static member function is just like binding a normal function. The func() … Continue reading “C++ | Binding a Member Function”

C++ | std::bind(), the forwarding call wrapper

C++11 introduced the std::bind() to create a forwarding call wrapper for a function associated argument values. We can bind a function with its parameters to get a callable object. We can call that object anytime later. In fact, calling that callable object and the actual function with the bound parameters are the same. Let’s take … Continue reading “C++ | std::bind(), the forwarding call wrapper”

C++ | Two Dimensional Vector

Two dimensional vector (or 2D vector) in C++ represents a table like structure that has two dimensions, row and column. It is, in fact, a standard STL vector of type vector. Vectors can be nested up to any depth. Here we’ll use two level nesting for two dimensions. Initialization We can initialize the values of … Continue reading “C++ | Two Dimensional Vector”

0
0
0
0
0
0