Hi all, i am trying to print out IP addresses from IP header structures.

I know that they in format w.x.y.z were each represents one byte.

But Ip_src and Ip_dst are Ulong and a subscript requires a pointer.

Any help pls.

abiola.

Re: printing ip addresses by Gabriel

Gabriel
Wed Feb 09 13:26:35 CST 2005


"abiola" <a.abimbola@napier.ac.uk> wrote in message
news:OA5Gg%23sDFHA.2156@TK2MSFTNGP10.phx.gbl...
> Hi all, i am trying to print out IP addresses from IP header structures.
>
> I know that they in format w.x.y.z were each represents one byte.
>
> But Ip_src and Ip_dst are Ulong and a subscript requires a pointer.

ULONG is a DWORD that is 4 BYTE's, each representing one of the 4 IP
numbers.

you can acces each of the bytes like this
(LPBYTE(&Ip_dst))[i]; // where i is 0,1,2,3;

>
> Any help pls.
>
> abiola.