I have the following source:
#include
using namespace std;
void main(int j)
{
char arr[10][10];
char** ptr;
ptr = arr;
}
I thought arrays in c++ were just pointers.
No, an array is a set of objects laid out contiguously in memory. In some circumstances, they are convertible to a pointer to the first element.
So a
char[][]could also bechar**
No. It is convertible to a pointer to the first one-dimensional array (which is the type char (*)[10] mentioned in the error message); but that array is not a pointer, so it is not convertible to a pointer-to-pointer.