CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 1999
    Posts
    6

    IP Address VS Host Name

    I need a function, which accept a host name and return the IP address of the same machine, and a function that performs opposite.

    Are in Visual C++ such functions or have anyone an idea how to write them ?


  2. #2
    Join Date
    Jul 1999
    Location
    Australia
    Posts
    39

    Re: IP Address VS Host Name

    Use gethostbyname and gethostbyaddr, or any of the other gethostby... functions. Both return a structure (hostent/HOSTENT) whereby you should be able to extract that information.


  3. #3
    Join Date
    Jun 1999
    Posts
    26

    Re: IP Address VS Host Name

    use gethostname to get the name of your local machine, too
    Dennis


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured