im having difficulty getting my ip from within a winsock program. this is mainly due to my inability to understand this:
type
hostent = record
{ official name of host }
h_name: pchar;
{ alias list }
h_aliases: ^pchar;
{ host address type }
h_addrtype: SmallInt;
{ length of address }
h_length: SmallInt;
{ list of addresses }
case byte of
0: (h_addr_list: ^pchar);
1: (h_addr: ^pchar)
end;how do i understand the case statement? what does 'case byte of' refer to? in all the c examples i have read, they indicate that h_addr_list should contain an array of addresses for the host, i.e. me. however, the length of this list is always 4 bytes, which is only one address, and it's always the same as h_addr, both pointing to the loopback address. the c examples all use h_addr_list as an array. why isn't this an array here? im seriously confused.
can anybody help me out? i need to know my modem's ip address so that i can instruct other people to connect to that address. its kind of a pain to always have to run ipconfig. my users won't like that, and i shouldn't have to teach them to do that if i can just divine the address within my program.
regards,
ron wilson
