Hello,
when determining sizeof structs, does the sizeof() interprets char *string[10] as size of one pointer or size of 10 characters?
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.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
so lets say natural alignment of pointer is 4, total size of the char *string[10] = 40?
Yes.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
thanks