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)));