Hello,
when determining sizeof structs, does the sizeof() interprets char *string[10] as size of one pointer or size of 10 characters?
This is a discussion on determining size of struct within the C Programming forums, part of the General Programming Boards category; Hello, when determining sizeof structs, does the sizeof() interprets char *string[10] as size of one pointer or size of 10 ...
Hello,
when determining sizeof structs, does the sizeof() interprets char *string[10] as size of one pointer or size of 10 characters?
It returns the size of 10 pointers to char.
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
so lets say natural alignment of pointer is 4, total size of the char *string[10] = 40?
Yes.
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
thanks