aluiken
asked on
Long ip's
Hi there,
Does anyone have a peice of source code for me that can convert a 32-bit long ip (eg 3498393929112 ???) to an normal ip adress like 192.168.0.1 en visa versa.
Thanks
Does anyone have a peice of source code for me that can convert a 32-bit long ip (eg 3498393929112 ???) to an normal ip adress like 192.168.0.1 en visa versa.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
P.S: Add "winSock" to your "uses" clause.
sh*t - u've been faster again...
;-)
SlowDeath.
;-)
SlowDeath.
ASKER
Okiz, but the other way around ?
Or is the func to convert a '192.168.0.1' like to an long the inet_addr func ?
Or is the func to convert a '192.168.0.1' like to an long the inet_addr func ?
My example does both. "inet_addr" converts a string into an integer. "inet_ntoa" goes the other way round (integer -> string). Easy, isn't it!? :-)
Sorry to SlowDeath... :-))
P.S: If you want to convert a string variable into an integer, do this:
intVar:=inet_addr(pchar(st rVar));
Sorry to SlowDeath... :-))
P.S: If you want to convert a string variable into an integer, do this:
intVar:=inet_addr(pchar(st
ASKER
Okiz thx !
If it works, please don't forget to accept my answer... :-)
ASKER
Sorry =) got the wrong button.
(Did not check it if it works tough)
Greets
(Did not check it if it works tough)
Greets