Dereference a structure to get value of first member
问题 I found out that address of first element of structure is same as the address of structure. But dereferencing address of structure doesn't return me value of first data member. However dereferencing address of first data member does return it's value. eg. Address of structure=100, address of first element of structure is also 100. Now dereferencing should work in the same way on both. Code: #include <iostream> #include <cstring> struct things{ int good; int bad; }; int main() { things *ptr =