c - printf ipv6 address using struct in6_addr and ipv4 address using u_int32_t -


this question has answer here:

i want printf values of ipv6 address type struct in6_addr , ipv4 address type u_int32_t console.

i have tried type casting yields error

error: aggregate value used integer expected printf("---------------- ipv4= %zu ipv6 = %zu ",(size_t)ipv4, (size_t)ipv6); 

i have tried %s ,%lu , many other ways after going through old question in stack overflow , other places .

if has solution shall thankful .

in6_addr struct contains union, can't cast size_t , hope work. should use inet_ntop convert human-readable form. see http://www.beej.us/guide/bgnet/output/html/multipage/inet_ntopman.html more info.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -