How to write a IPV6 loopback address in array form
The IPV4 address has been written as { 127, 0, 0, 1 } How to write the loopback address in IPV6 in this format. Do I need to take a 16 sized开发者_JAVA百科 array??? Isnt there any better way ???
Well, IPv6 has many "shortened" forms, so that a loopback address can be written as ::1
- however, in an array, you'd need to spell out the entire thing (16 * 8 = 128 bits):
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }
精彩评论