fetch value of ipaddress

Posted by neha soni on Stack Overflow See other posts from Stack Overflow or by neha soni
Published on 2010-04-01T12:03:13Z Indexed on 2010/04/01 12:13 UTC
Read the original article Hit count: 320

Filed under:
|

i want to get ipaddress of mycomputer in a variable this statement prints ipaddress of my computer but i want to assign it in a varible how can i fetch the value of ipaddress from inet_ntoa(inaddrr(ifr_addr.sa_data)) into an variable ip of char* type .

printf("IP Address: %s\n", inet_ntoa(inaddrr(ifr_addr.sa_data)));

© Stack Overflow or respective owner

Related posts about linux

Related posts about c