So, I've figured out how to dereference a multidimensional array like this:
#include <tchar.h>
#include <iostream>
wchar_t g_pppwcSymbol[2][3][4];
int main(int argc, TCHAR **argv)
{
(* (*( (*(g_pppwcSymbol+1) )+2 )+3 ) ) = L'K';
std::wcout<<g_pppwcSymbol[1][2][3];
std::wcin.get();
return 0;
}
Output: K
However, I've also heard that the compiler transforms this into a 1-dimensional array, is that correct? This would mean that all the wchar_t elements follow up each other in the memory. So there must be a way to do something like this:
***(g_pppwcSymbol + x) = value;
However I'm not sure how this works exactly. Could someone elaborate?
EDIT:
this seems to work so far:
int main(int argc, TCHAR **argv)
{
/*(* (*( (*(g_pppwcSymbol+1) )+2 ) + 3)) = L'K';*/
/*std::wcout<<g_pppwcSymbol[1][2][3];*/
***(g_pppwcSymbol + 1) = L'K';
std::wcout<<g_pppwcSymbol[1][0][0];
std::wcin.get();
return 0;
}
output: K
NEXT EDIT:
Working model:
static const int X = 2;
static const int Y = 3;
static const int Z = 4;
wchar_t g_pppwcSymbol[X][Y][Z];
int main(int argc, TCHAR **argv)
{
int iAccess = ((Y*Z) * 1) + ((Z) * 2) + 3;
*( (**g_pppwcSymbol) + iAccess) = L'K';
std::wcout<<g_pppwcSymbol[1][2][3];
std::wcin.get();
return 0;
}
Output: K