Difference between printing the address and Structure address [closed]

The pre-conditions of the printf function require that you pass a data pointer as an argument to %p – and more specifically, a pointer of type void*.

obj1 is not a data pointer; it is an instance of issue. The behaviour of violating the pre-conditions of printf is undefined. obj1.issue_c2 is a pointer, but it is a pointer to const char rather than void, so it also violates the pre-condition.

Browse More Popular Posts

Leave a Comment