Does anyone know the correct grammar for allocating a multidimensional array on the heap?
I have tried:
CHAR **Z = new CHAR;
CHAR *Z = new CHAR;
Upon further investigation is appears that C++ treats multidimensional arrays as distinct data types. This means that the problem in the above examples is that it can't assign a multidimensional array TYPE to any of the pointer types I have tried.
It has no problem, however translating between simple pointer types and SINGLE dimensional arrays. I suppose that the language is required to keep track of the number of elements in each dimension, so that it can perform the proper indexing when you supply subscript operators. So this must be the reason that the arrays are incompatible with simple pointer types, because simple pointer types do not carry such information around with them.
Thanks for the replies!
there is another problem! I am bulding this project without MFC support. So I selected New->Win Static Library. Also i unchecked MFC support.
Now while calling this getString method, i need handle for the application which is using the library. When i tried defining getString prototype, it gives me error as HINSTANCE is undefined identifier.
I am defining getString as