ch;
int id;
};
auto ptr = new Info;
it is confuse me, I am beginner .
so now info address is point to the first field argument which is allocated on the stack ? right ?
then ?!
is ch allocated on the heap ?
Changing the fields as pointers struct Info { char *ch; int * id; }; the size of Info became larger than the last one which ( 8 bytes) ( because padding ) but it became ( 16 bytes ) after make them pointers ?! and the struct address is not pointing to the first field address which is not allocated yet ?!
it's defined on heap (physical address locator) and has a counter of references related with stack call handlers.
pointer's size may vary between 4 and 20 bytes, it depends of compiler.
yes the pointer size is 8 bytes
Обсуждают сегодня