Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to retrieve the IP address of a system?

how to retrieve the IP address of a system?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Malini Nair
    wrote on last edited by
    #1

    pls do help M.V.Nair

    V 1 Reply Last reply
    0
    • M Malini Nair

      pls do help M.V.Nair

      V Offline
      V Offline
      vimal_q
      wrote on last edited by
      #2

      try

      Malini Nair wrote:

      gethostbyname()

      gethostbyname()for better you just search google by this string gethostbyname() in vc++

      vimal

      M 1 Reply Last reply
      0
      • V vimal_q

        try

        Malini Nair wrote:

        gethostbyname()

        gethostbyname()for better you just search google by this string gethostbyname() in vc++

        vimal

        M Offline
        M Offline
        Mila025
        wrote on last edited by
        #3

        Hi, gethostbyname ... has been deprecated ;-) use: int getaddrinfo( const char* nodename, const char* servname, const struct addrinfo* hints, struct addrinfo** res ); addrinfo host; LPADDRINFO res; ... host.ai_flags = AI_CANONNAME; host.ai_protocol = IPPROTO_TCP; host.ai_family = PF_INET; host.ai_socktype = SOCK_STREAM; getaddrinfo( strMachineName, NULL, &host, &res ); ...

        ----------- Mila

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups