Exercise 5: Implementing Double Pointers

In this exercise, you will be required to create a Board of any size using double pointers

We'll cover the following

Problem Statement

This exercise will require you to implement double pointers in C++.

In this exercise,

  • You are required to create a Board for any number of rows and columns.
  • Write the code for the above-mentioned task in the makeBoard function.
  • Next, you have to write the printBoard function. In it, you have to do the following:
    • Pass the appropriate parameters to it
    • Initialize the board to store the value 1 at every index in the board.
    • Display your resulting board.
  • Lastly, call the printBoard function in the makeBoard function by passing the appropriate parameters to it.

Dummy Example

Input: 5 rows and 4 columns

Expected Output:​

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy