Can Dynamic Multi-Dimensional arrays in C++ be initialized using nullptr

Viewed 72

I'm trying to initialize a class variable which is a dynamic multidimensional array. My goal is not to fill the array with values during constructor phase. I would just like to initialize this variable such that it doesn't store garbage values.

a rough idea of my code:

Class a {

    Object **theArray;

    a() {
      theArray = nullptr
    }

}

The dynamic 2D array is meant to be allocated sometime later in execution. My question is, is this a valid operation and does it effectively make the 2D array point to nullptr instead of garbage values?

0 Answers
Related