Hi All,
I have a struct like this:
and in my main() I haveCode:struct Cache { int *** cache; };
I want to set the int *** cache to the same 3D array called "cache" in main. However, when I try something like "sim.cache[1][1][1] = 0;", I get a segfault.Code:int cache[8][1][1]; struct Cache sim; sim.cache = (int ***)cache;
I don't know if I'm initializing the 3D array in my struct correctly. Can someone confirm please?
Thanks,
Colin