I have a struct that looks like this.
struct puzzle {
int d[16];
};
I heard that arrays and pointers are the same in C/C++, so I thought that the struct would store a pointer, and the pointer points to an int array. However, I did simple experiments using a debugger to see how exactly is it stored, and I found out that the array is directly stored in the struct.
- Why isn't the array pointer stored in the struct?
- Where is the pointer stored at?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire