I'm new to C++, and I've been trying to figure out how to access just 1 element in a 2D array that I've dynamically allocated like so:
char** array;
array = new char*[3];
for(int i = 0; i < 3; i++) {
array[i] = new char [3];
}
I've been trying to access it like this:
cout<< array[0][0];
Whenever I try to do this, nothing prints out and the program segfaults. How should I fix it so that it prints? Thank you for your time!