1.Why is it displaying 5 and 6 which are contents of ptr1 ,when I actually displayed contents of ptr2 which should have resulted in segmentation fault.
2.when it didnt lead to segmentation fault I displayed ptr1 and ptr2 and difference between those two pointers is just 2 bytes(0x84ba010-0x84ba008=2) which should be 4 bytes as elem struct has 2 integers.