Reputation: 5145
I'm using C. How can I print the values of a member of an instance of a structure? Is it possible? At least is it possible in case of a structure declared as global variable (not a dynamically allocated one)?
Upvotes: 1
Views: 1489
Reputation: 13026
set print objects on
p structVar
p *pointerToStructVar
Or, more explicitly:
p structVar.member
p pointerToStructVar->member
Upvotes: 3