How to get the IPv6 address in run time and print the same... I have did the following program, but it is printing some garbage values. It is not taking the value which i am giving...
Code:#include<stdio.h> struct in6_addr { unsigned char s6_addr[16]; }; int main() { int i; struct in6_addr ipv; ipv.s6_addr[16]="128.12.343.65.76.89.0.0.0.0.0.12.56.75.44.187.199"; for(i=16;i>=1;i--) printf("%u.",ipv.s6_addr[i]); }