Thread: Dev-C++ and my IP

  1. #1

    Dev-C++ and my IP

    I am writing my first good winsock program, and it requires the IP address of the host computer. I have searched the forums, and my books and tutorials, and have not found a good way to do this. The thing that hinder's me is that i con't have inet_atoi(), or don't know how to use it. If someone knows how to do this, or has some insight, i would be very appreciative.

    ~Inquirer
    Compilers:
    GCC on Red Hat 8.1 (Primary)
    GCC on Mac OS X 10.2.4 (Secondary)

    Others:
    MinGW on XP

  2. #2
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    I'll bet a dime that the IP address for the host computer is 127.0.0.1.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  3. #3
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    >I'll bet a dime that the IP address for the host computer is 127.0.0.1.

    I think he means external IP address.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  4. #4
    Registered User
    Join Date
    Oct 2002
    Posts
    3

    ip?

    what they said is the local. If your on a router or shared connection the ip everyone out here sees is the same for each computer. If it is one computer on the web directly just go to ipchicken.com

  5. #5
    Registered User SPiRiToFCaT's Avatar
    Join Date
    May 2002
    Posts
    35
    >If it is one computer on the web directly just go to ipchicken.com

    He wants to find his computer's internet IP from within his program, not a website.

    Sorry, I don't know how to do it either.
    Maybe there is some documentation on inet_atoi() somewhere out there on google or something...
    - Well that's my 4c Australian.

  6. #6
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed