2

I've a

struct addrinfo *s;

and i want to see the fields

struct sockaddr *ai_addr;

inside my struct (s) when I'm in debug mode. I use code-blocks ide for testing my programs, and in the Debug Watches window I have set the correct watch

*s->ai_addr

but it print only the memory address. Then I use the debugger console of the ide, and i try to print the ai_addr struct with this command

p s->ai_addr

but gdb print the address again. How I can print correctly the content of the ai_addr struct in debug mode?

1 Answer 1

1

Because you trying to print ai_addr which is pointer aka address

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.