C++ Programming Language Table of content:
2D Vector In C++ | Declare, Initialize, & Operations (+Examples)
C++ is a powerful general-purpose programming language with robust support for data structures through its Standard Template Library (STL). Among the most flexible STL containers are 2D vectors—dynamic, resizable arrays that allow developers to efficiently represent matrix-like data structures.
In this article, we’ll walk through everything you need to know about 2D vectors in C++, including their declaration, initialization methods, core operations, use cases, advantages over traditional arrays, and practical code examples.
What are 2D Vectors in C++?
A 2D vector in C++ programming is essentially a vector of vectors, where each inner vector represents a row of elements. This structure mimics a matrix but with the added benefit of dynamic sizing—both rows and columns can grow or shrink during runtime. Think of a 2D vector as a table:
Each row is a std::vector<T> (where T is the data type), and all rows are stored inside another vector—std::vector<std::vector<T>>.
To use 2D vectors, include the standard <vector> header file and work within the std namespace. These structures are particularly useful in domains that require grid-based data handling, such as:
- Image processing
- Game development
- Simulations
- Scientific computations
- Pathfinding and graph algorithms
Syntax for Declaring a 2D Vector in C++
Here’s the basic syntax to declare a 2D vector in C++:
#include <vector>
std::vector<std::vector<int>> matrix;
This creates an empty 2D vector of integers. You can also initialize it with dimensions:
int rows = 3, cols = 4;
std::vector<std::vector<int>> matrix(rows, std::vector<int>(cols, 0));
In this example, we’ve initialized a 3x4 matrix where all elements are set to 0.
How to Declare 2D Vectors in C++
To work with 2D vectors in C++, you must first include the header file vector at the top of your program:
#include <vector>
This gives you access to the std::vector template class, which supports dynamic arrays of any data type. The vector header file is part of the standard library and provides the necessary functionality/ implementation of the vector class template, which allows us to create, manipulate, and manage 2D vectors in C++ language.
You can initialize a 2D vector in multiple ways:
- Using fill constructor
- Using initializer lists
- Using push_back() to build it row-by-row
Each method offers flexibility depending on the situation—whether you're initializing with fixed values, reading dynamic input, or building the vector iteratively. We will discuss these in the next section. Before that, let's look at a basic example for the declaration of a 2D vector in C++.
Code Example:
Code explanation:
- We are declaring a vector called vector v2.
- There are no values assigned to it, and it is not initialized.
- Since there are no elements to display, this code will produce no output. This is just the basic declaration of a 2D vector.
Time Complexity: O(1)
Space Complexity: O(1)
How to Initialize a 2D Vector in C++?
We have already seen how to declare a 2-dimensional vector. What comes next? You guessed it right; we are talking about initializing C++ 2D vectors. There are several methods to initialize a 2D vector in C++. Here are some common approaches:
2D Vector Initialization in C++ Using Fill Constructor
In C++, you can initialize a 2D vector using the std::vector fill constructor. This constructor allows you to create a 2D vector with a specific number of rows and columns, and all elements will be initialized to the given value. Here's how you can do it:
Code: To initialize a 2D vector of n rows and m columns with a value of 0.
Output:
0 0 0 0
0 0 0 0
0 0 0 0
Explanation:
In this example, the std::vector fill constructor is used to create a 2D vector named twoDVector.
- We begin by declaring three integer variables, rows, columns, and initialValue, and initialize them with the values of 3, 4, and 0, respectively.
- These variables are then used to initialize a vector with the std::vector fill constructor, as mentioned in the code comments.
- The vector has 3 rows and 4 columns, and all elements are initialized to the initialValue (which is set to 0 in this case).
This method is particularly useful when you want to initialize a 2D vector with the same value for all elements.
2D Vector Initialization in C++ Using resize() Function
In C++, you can initialize a 2D vector using the resize() function from the std::vector class. The resize() function allows you to specify the size of the 2D vector, and if needed, it also initializes the elements to a default value (0 for integers, 0.0 for doubles, etc.). The example given below shows how this can be done.
Code Example:
Output:
0 0 0 0
0 0 0 0
0 0 0 0
Explanation:
In this example, the 2D vector twoDVector is initialized to have 3 rows by calling twoDVector.resize(rows);.
- We begin by including the iostream and vector header files.
- Then we declare and initialize three integer variables, rows, columns, and initialValue, and assign the values of 3, 4, and 0, respectively.
- The std::vector is then used to create a 2D vector named twoDVector with 3 rows and four columns, where each element is 0 (initialValue).
- Next, we call the resize() function to set the number of columns for that row and initialize all elements to the initialValue (which is set to 0 in this case).
- We then use nested for loops and the cout statement to input the value of each element of the vector and print it, respectively.
2D Vector Initialization in C++ Using push_back() Function
To initialize a 2D vector in C++ using the push_back() function, you can start with an empty 2D vector and dynamically add rows (vectors) to it using push_back(). Then, you can use push_back() again to add elements to each row. Look at the example below to see how it can be done.
Code Example:
Output:
1 2 3
4 5 6
7 8 9
Explanation:
- In this example, we first declare an empty 2D vector called twoDVector.
- We then add three rows to the 2D vector using the push_back() function thrice.
- Each row is represented by a vector of integers, i.e., {1, 2, 3}, {4, 5, 6}, and {7, 8, 9}, respectively.
- The nested for loop then works to input the value of the vector elements.
- The output is printed using the cout statement. It shows the 2D vector initialized with 3 rows and 3 columns, with custom values in each element as specified.
Note: Using push_back() is particularly useful when the size of the 2D vector is not known beforehand and needs to be populated dynamically.
2D Vector Initialization in C++ Using Initializer Lists
Initializer lists are a convenient syntax for initializing objects, including vectors, with a list of values. It allows us to provide initial values directly when creating the object. It is a common way of initializing elements of 2D vectors and is widely used.
Code Example:
Output:
1 2 3
4 5 6
7 8 9
Explanation:
In this example,
- We declare and initialize a vector called twoDVector directly using an initializer list.
- The curly braces indicate the rows of the 2D vector, and the nested curly braces represent the elements within each row.
- The output shows the 2D vector initialized with 3 rows and 3 columns, with custom values in each element as specified in the initializer list.
Using initializer lists is a convenient and concise way to initialize 2D vectors when you know the values you want to assign beforehand. It provides a cleaner syntax compared to other methods, like using nested loops or push_back().
Creating a 2D Vector in C++ with User Input for Column & Row Size
We can create 2D vectors in C++, where we can input the number of rows and columns and the element values to be stored in the 2D vector from user input. We make use of the fill constructor to create our custom 2D vector, where the number of rows, the number of columns, and the elements can be received as input from the keyboard by the user.
The example below shows how to create a 2D vector with a user-defined size and input values.
Output:
enter no.of.rows: 3
enter no.of.cols: 4
enter the elements to be stored in 2D vector:
1 2 3 4
5 6 7 8
9 10 11 12Printing the 2-D vector:
1 2 3 4
5 6 7 8
9 10 11 12
Code explanation:
- The code prompts the user to enter the number of rows and columns for a 2D vector using the cout command and scans the input with cin.
- It then declares and initializes the vector with the specified vector dimensions.
- Once again, it prompts the user to input the elements to be stored in it through nested for loops and the cin stream.
- Finally, it uses nested for loops and cout to print the elements of the vector.
Time Complexity: O(m*n), where m is the no. of rows and n is the no. of. columns
Space Complexity: O(m*n) where m*n is the no.of elements in the 2D vector.
Note: This code can be used to create 2D vectors of varied sizes by changing the input based on the requirement. For example, by giving the same input for the number of rows and columns, we get a 2D vector with an equal number of rows and columns. If each element we store in the vector is zero, then we get a 2D vector with all values set to 0. So, experiment with input to generate various examples of 2D vectors.
Methods for Traversing 2D Vectors in C++
In C++, there are several methods to traverse (iterate through), manipulate, and print the elements of a 2D vector (vector of vectors). Here are some common methods:
Range-Based For Loops to Traverse 2D Vector in Cpp
A very easy and efficient way to traverse 2D vectors in C++ is by using a range-based for loop. They provide an effective and convenient way to iterate over a 2D vector without having to use iterators explicitly. Given below is a code sample to help you better understand how range-based for loops are used
Code Example:
Output:
1 2 3
4 5 6
7 8 9
Code explanation:
- The given code declares and initializes a 2D vector using an initializer list.
- The vector contains 3 inner vectors, which represent the ropes of the 2D vector.
- It then uses a range-based for loop to traverse the vector and print its integer variables.
Time Complexity: O(m*n), where m is the no. of rows and n is the no. of columns
Space Complexity: O(m*n) where m*n is the no.of elements in the 2D vector.
Traversing 2-D Vectors in C++ Using Iterators
Iterators are objects that allow traversal and access to the elements of 2D vectors in C++. They provide a flexible and powerful way for sequential iteration over the elements of the 2D vector, helping in facilitating operations such as accessing, modifying, and erasing elements. Row iterators are used to iterate through rows, while column iterators are used to iterate through columns of a 2D vector.
Code Example:
Output:
printing the 2D vector:
1 2 3
4 5 6
7 8 9printing the 2d vector after modifying the elements:
2 4 6
8 10 12
14 16 18
Code explanation:
- The code initializes a 2D vector with values using an initializer list and prints the vector using iterators.
- It uses nested for loops along with iterator values to traverse the vector.
- It then modifies each element of the vector by multiplying it by 2, prints the modified vectors using a combination of iterators, and nests them in for loops.
Time Complexity: O(m*n), where m is the no.of rows and n is the no. of columns
Space Complexity: O(m*n) where m*n is the no. of elements in the 2D vector.
Indexing to Iterate Over a 2D Vector in C++
Using indexing to iterate over a vector is a straightforward approach and allows you to access and process individual elements of the vector easily. We can utilize indexing to iterate over a vector in C++ using a simple for loop. Here's an example:
Code:
Output:
Using indexing to iterate over the vector:
10 20 30 40 50
Explanation:
- In this example, we have a vector called myVector with elements {10, 20, 30, 40, 50}.
- We use indexing with a for loop counter i to access each element of the vector.
- The loop runs from i = 0 to i = myVector.size() - 1, where myVector.size() gives the number of elements in the vector.
- In each iteration of the loop, we use myVector[i] to access and print the element at the index i.
Interview Spotlight: 2D Vectors in FAANG Interviews
Handling 2D vectors confidently is frequently tested in real-world C++ interviews, especially for roles at top-tier software companies:
- FAANG-style interviews often feature matrix-based challenges, such as “count the number of unique islands” in a 2D grid, designed around vector<vector<int>> and DFS traversal. Solving these requires a clear understanding of 2D vector access patterns and performance implications.
- A Redditor shared insights from a finance-tech interview (e.g., Goldman Sachs/JP Morgan):
“They had me initialize a 2D vector, fill it, then re-size dynamically for variable partitions… part of assessing memory layout understanding.” - Embedded or systems-focused companies like Vector India ask practitioners to manipulate hardware-style matrices using 2D vectors, testing your ability to handle bounds, safety, and initialization correctness effectively.
Why It Matters:
- Interviewers are not just assessing if you can declare a vector<vector<int>>, but whether you can correctly initialize, resize, and avoid common pitfalls such as segmentation faults.
- Demonstrating that you can traverse, resize, and populate 2D vectors accurately proves your readiness for real-world C++ workloads and is a strong signal in coding interviews.
Practice Your Skills with Unstop
Polish your C++ vector manipulation skills and simulate real-world interview scenarios with our interactive challenges on Unstop Practice. Test yourself with curated, feedback-driven exercises and build confidence ahead of your next technical interview.
Printing 2D Vector in C++ Using Nested Loops
To print a 2D vector using nested loops in C++, you can use two nested for loops—one for iterating through the rows and another for iterating through the elements within each row. Here's an example:
Code:
Output:
Using nested loops to print the 2D vector:
1 2 3
4 5 6
7 8 9
Explanation:
- In this example, we first create a 2D vector called twoDVector directly with initializer lists.
- We then use two nested for loops to iterate through the rows and elements within each row.
- The outer loop (i) iterates through the rows using twoDVector.size(), and the inner loop (j) iterates through the elements of each row using twoDVector[i].size().
- Inside the inner loop, we access each element of the 2D vector using the indexing twoDVector[i][j] and print it using std::cout.
- After printing all elements of one row, we move to the next line using std::cout << std::endl; to display the rows one by one.
- This method is straightforward and allows you to access and print individual elements of the 2D vector efficiently.
To know about other methods of printing, read: How to Print A Vector in C++ | 8 Methods Explained With Examples
Example C++ Programs for Creating 2D Vectors
Example 1: Creating a 2-Dimensional vector of an equal number of columns.
Output:
1 1 1
1 1 1
1 1 1
1 1 1
Explanation:
In the code above,
- We create a 2D vector named twoDVector with 4 rows and 3 columns, where all elements are initialized to 1.
- We use nested loops to loop through the 2D vector and output its elements row by row.
- The output will be a 4x3 grid with all elements set to 0.
Example 2: To define a 2D vector with different sizes of columns.
Output:
1 2 3
4 5
6 7 8 9
10
Explanation:
In the example above,
- We create a 2D vector named twoDVector using the std::vector container.
- Each row of the 2D vector is represented by a separate inner vector.
- The twoDVector is initialized with four rows of different sizes: Row 0: {1, 2, 3} (3 columns) Row 1: {4, 5} (2 columns) Row 2: {6, 7, 8, 9} (4 columns) Row 3: {10} (1 column)
- The program then outputs the contents of the 2D vector.
- Each row is printed on a separate line, and the elements within each row are separated by spaces.
- The output shows the 2D vector with different sizes of columns for each row, as specified during initialization.
Example 3: To define a 2D vector of n rows and m columns with input values
Output:
Enter the number of rows: 3
Enter the number of columns: 2
Enter 6 integer values:
3 5 6 0 8 6
The 2D vector you entered:
3 5
6 0
8 6
Explanation:
In this code:
- We begin by declaring two integer variables n and m, in the main function.
- Then, using std::cout, we print the strings 'Enter the number of rows' and 'Enter the number of columns', thus prompting the user to input the number of rows and columns.
- The inputs are read using the std::cin.
- Next, we create a 2D vector
twoDVectorwithnrows andmcolumns using std::vector. - We then use nested loops to input values for each element of the 2D vector.
- The program then outputs the contents of the 2D vector to display the values entered by the user.
- When you run this program, it will prompt you to enter the number of rows and columns, followed by "n * m" integer values.
- After entering the values, the program will display the 2D vector with the entered values.
Check this out Boosting Career Opportunities For Engineers Through E-School Competitions
How to Access & Modify 2D Vector Elements in C++?
Accessing and modifying elements in 2D vectors in C++ can be performed using different methods. In this section, we will discuss two of the most popular methods, i.e., using double square brackets and the at() function.
Using Double Square Brackets([ ] [ ])
2D vectors can be accessed in the same way as accessing and modifying 2D arrays in C++ by using the double square brackets and specifying the indexes pertaining to the row and column of the element we want to access. However, this method does not provide bound checking, and hence, 'out of range' exceptions will not be thrown if we access indices that are not in the vector.
Code Example:
Output:
printing the 2D vector:
1 2 3
4 5 6
7 8 9printing the 2d vector after modifying the elements:
1 2 3
4 5 0
7 0 9
Code explanation:
- The code declares and initializes a 2D vector using an initializer list. It then prints the original vector using nested for loops.
- It then modifies specific elements of the vector by accessing their indices using double square brackets(“[][]”), and we assign new values to those indices.
- We then print the modified vector using nested for loops.
Time Complexity: O(m*n), where m is the no. of rows and n is the no. of columns
Space Complexity: O(m*n) where m*n is the no.of elements in the 2D vector.
Using The at() Function
The at() function is another method that is used to access and modify elements of 2D vectors in C++. It has a very useful advantage in that it provides bounds checking, and hence, an 'out of range' exception will be thrown, which helps us debug and maintain the code. The indices are specified pertaining to the row and column of the element in the 2D vector.
Code Example:
Output:
printing the 2D vector:
1 2 3
4 5 6
7 8 9printing the 2d vector after modifying the elements:
1 2 3
4 5 0
7 0 9
Code explanation:
- The code declares and initializes a 2D vector using an initializer list.
- It then prints the original vector using nested for loops and cout statements.
- It then modifies a specific single element of the vector by accessing its index using the at() function, and we assign new values to those indices.
- We then print the modified vector using nested for loops.
Time Complexity: O(m*n), where m is the no. of rows and n is the no. of columns
Space Complexity: O(m*n) where m*n is the no.of elements in the 2D vector.
Also read: C++ Find() In Vector | How To Find Element In Vector With Examples
Adding Elements to 2D Vector Using push_back() Function
The push_back() function in C++ is used to add elements to the end of a vector. In the case of a 2D vector, it is used to add new rows to the vector. Each row can have a different number of elements, allowing for a dynamic structure. It’s a powerful tool, which is the main advantage when it comes to a vector’s dynamic nature.
Code Example:
Output:
1 2 3
4 5
7 8 9
Code explanation:
- The code initializes an empty 2D vector and then adds multiple rows to it using the push_back() function.
- Each row is a vector.
- The nested for loops then iterate over the vector and print its elements using the at() function to access individual elements.
Time Complexity: O(m*n), where m is the no. of rows and n is the no. of columns
Space Complexity: O(m*n) where m*n is the no. of elements in the 2D vector.
Removing Elements from Vector in C++ Using pop_back() Function
The pop_back() function in C++ is used to pop or remove elements from a vector. The value is removed from the end of the vector. In the case of 2D vectors, the pop_back() function removes the last row of the 2D vector, thus decreasing the number of rows by 1.
The example below helps you better understand how the pop_back() function works.
Code Example:
Output:
before pop_back():
1 2 3
4 5
7 8 9after pop_back():
1 2 3
4 5
Code explanation:
- The code declares an empty 2D vector and adds multiple rows to it by using the push_back() function.
- It then prints the vector by using nested for loops and cout statements.
- It then calls the pop_back() function to remove the last row of the vector.
- The program again uses the cout statement to print the modified vector using a nested for loop.
Time Complexity: O(m*n), where m is the no. of rows and n is the no. of columns
Space Complexity: O(m*n) where m*n is the no.of elements in the 2D vector.
Did You Know? Real-World Outage: Crash Cause Linked to 2D Vector Usage
In one notable case, a game engine (based on Unreal Engine) crashed repeatedly due to an incorrect 2D std::vector setup:
- A developer attempted to create a grid of actor pointers using a 2D vector without setting the correct sizes for both dimensions.
- Accessing elements beyond the allocated rows or columns led to segmentation faults during runtime.
- The root cause was missing resize() calls before insertion, which caused invalid memory access when the engine iterated over expected elements.
Lesson learned:
- Always initialize both dimensions of a 2D vector before using nested indexing.
- A missing resize() call might compile fine but crash at runtime with tough-to-debug errors.
- Proper initialization and bounds checking are essential for safety, especially in performance-critical or memory-sensitive applications.
Advantages of 2D Vectors Over Traditional Arrays
2D vectors in C++ offer several advantages over traditional arrays when it comes to representing and manipulating two-dimensional data. Let's explore some of the key advantages:
- Dynamic Size: One of the significant advantages of 2D vectors is that they allow dynamic sizing. Unlike traditional arrays, which require a fixed container size specified at compile time, 2D vectors can be resized at runtime using functions like
resize()orpush_back(). This flexibility enables you to adapt the size of the 2D vector based on the actual data requirements, making it more convenient for real-world applications where data size may vary. - Memory Management: 2D vectors handle memory allocation and deallocation automatically. In other words, they manage memory dynamically, meaning that memory is allocated when elements are added to the vector. It is deallocated when elements are removed or when vector items are destroyed. This eliminates the need for manual memory management, which is often error-prone and can lead to memory leaks or buffer overflows in traditional arrays.
- Ease of Initialization: Initializing a 2D vector is more straightforward and flexible compared to traditional arrays. You can initialize a 2D vector using the fill constructor, the resize() function, the push_back() method, or even with initializer lists, allowing for concise and readable code. In contrast, initializing traditional arrays typically involves nested loops or cumbersome syntax.
- Dynamic Row Sizes: 2D vectors can have rows of different sizes ( such as single-row vectors or multiple-row vectors), allowing the representation of irregular or jagged matrices. Traditional arrays require all rows to have the same size, which may lead to wasted memory if the data is irregularly structured.
- Range-based For Loop: With 2D vectors, you can use a range-based for loop to iterate through different types of vector elements more conveniently. This syntax simplifies the vector code and avoids potential off-by-one errors that can occur when using traditional loops with array indices.
- Standard Library Functions: 2D vectors are part of the C++ Standard Template Library (
std::vector), which means they come with numerous kinds of useful member functions and algorithms likesize(),empty(),begin(),end(), andinsert(). These functions make working with different forms of vectors more efficient and expressive. - Copy and Assignment: Copying or assigning 2D vectors is straightforward and safe. You can use the default copy constructor and assignment operator without worrying about deep copying or memory issues. Traditional arrays do not have a built-in copy or assignment functionality, and their manual copying can lead to bugs if not done correctly.
- Passing as Function Arguments: 2D vectors can be easily passed as function or positional arguments and returned from functions. They maintain their size and data, making it easier to work with functions that operate on multi-dimensional data.
Conclusion
In the above article, we have discussed, in detail, the concept of 2D vectors in C++ and some of its dynamic features, as well as the theory behind vector implementation. We now know that-
- 2D vectors are a powerful data structure in C++, providing a dynamic and efficient way to work with two-dimensional arrays.
- Their flexibility, ease of use, and built-in memory management make them a preferred choice for various applications.
- Understanding how to create, initialize, and traverse 2D vectors is essential for handling multi-dimensional data in C++ programs effectively.
- By mastering 2D vectors, you open up a world of possibilities in handling complex data structures and algorithms.
Also read- 51 C++ Interview Questions For Freshers & Experienced (With Answers)
Frequently Asked Questions
Q. Are there 2D vectors in C++?
Yes, just like a one-dimensional vector(1D vector), also known as a single-dimensional vector, there are two-dimensional vectors present in C++. A 2D vector is essentially a vector of vectors. Each element of the vector represents a row, and each row is a vector in itself that holds the individual elements of the row.
The basic syntax of a 2D Vector:
#include <vector>
std::vector<std::vector<DataType>> twoDVector;
Also read- Data Types In C++ | A Detailed Explanation With Examples
Q. What is a 2D vector called?
A 2D vector is essentially a vector with vectors. Each element of the vector represents a row, and each row is a vector in itself that holds the individual elements of the row. They are also commonly referred to as grids or matrices.
Q. How to initialize 2D vectors in C++ with a value?
Initializer lists are a convenient syntax for initializing objects, including vectors, with a list of values. It allows us to provide initial values directly when creating the vector object. It is a common way of initializing elements of two-dimensional vectors and is widely used.
Q. What is a fill constructor?
The fill constructor is a constructor that is available for vectors. It is used to initialize the vector with a specified number of elements, all set to the same given value. It allows for quick creation with a specified vector size and initializes all the items in the vector to a specified value.
Q. How is push_back() used for 2D vectors in C++?
The push_back() function in C++ is used to add elements to the end of a vector. In the case of a two-dimensional vector, a new row is added to the vector. Each row can have a different number of elements, allowing for a dynamic structure.
Q. How is pop_back() used for 2D vectors in C++?
The pop_back() function in C++ is used to pop or remove elements from a vector from the back of the vector. The value is removed from the end of the vector. In the case of 2D vectors, the pop_back() function removes the last row of the two-dimensional vector, thus decreasing the number of rows by 1.
Q. What is the resize() function for 2D vectors in C++?
The resize() function in C++ is another powerful method that makes normal vectors dynamic in nature and adds to the flexible nature of vectors. It allows us to add and remove rows or elements within the rows.
Q. How to create 2D vectors in C++ with user input?
We can create 2D vectors in C++, where we can input the number of rows and columns and the elements to be stored in the two-dimensional vector from user input. We can make use of the fill constructor to create our custom normal vector, where the number of rows, the number of columns, and the vector elements can be received as input from the keyboard by the user.
Q. Can 2D vectors in C++ be accessed in the same way as 2D arrays?
2D vectors can be accessed in the same way as accessing and modifying 2D arrays in C++ by using the double square brackets and specifying the indexes pertaining to the row and column of the element we want to access.
Q. What is the advantage of the at() function over indexing([][])?
The at() function is another method that is used to access and modify vector elements of 2D vectors in C++. It has a very useful advantage in that it provides bounds checking. This way, an 'out of range' exception will be thrown, which helps us debug and maintain the code. The indices are specified pertaining to the row and column of the element in the 2D vector in C++.
Test Your Skills: Quiz Time
QUIZZ SNIPPET IS HERE
QUIZZ SNIPPET IS HERE
QUIZZ SNIPPET IS HERE
You might also be interested in reading the following:
- Storage Classes In C++ & Its Types Explained (With Examples)
- Pointers in C++ | A Roadmap To All Types Of Pointers With Examples
- Typedef In C++ | Syntax, Application & How To Use It (With Examples)
- Guide To Switch Case In C++ & Important Keywords (With Examples)
- C++ If-Else & Other Decision-Making Statements (+Examples)