Nathan Campos
Nathan Campos

Reputation: 29507

How I Can Print The IP Of The Host

I'm learning C++ and i want to know how i can print the IP adress of the host machine, but remember that my program is a command line aplication(cmd), but i don't want the code, but some links here i can learn this, not copy and paste. Thanks!

Upvotes: 0

Views: 359

Answers (3)

mouche
mouche

Reputation: 1903

Check this out: Socket Programming.

Winsock looks like a good choice.

Upvotes: 1

Lennart Koopmann
Lennart Koopmann

Reputation: 21079

It's a very good approach to ask for something to learn, not ready code.

Read this if you are on Linux: Get the IP address of the machine

...or this if you are on Windows: http://www.codeguru.com/forum/showthread.php?t=233261

You could have found this on your own with a simple Google search.

// Edit: DeusAduro's link for Windows was much better. Changed it.

Upvotes: 1

DeusAduro
DeusAduro

Reputation: 6076

Google = How to find local ip addresses c++

Upvotes: 1

Related Questions