views:

128

answers:

3

Hello,

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!

+1  A: 

Google = How to find local ip addresses c++

DeusAduro
+1  A: 

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

Read this if you are on Linux: http://stackoverflow.com/questions/212528/linux-c-get-the-ip-address-of-local-computer

...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.

Lennart
I'm using Windows, thanks!!
Nathan Campos
+1  A: 

Check this out: Socket Programming.

Winsock looks like a good choice.

mouche
Thanks, this is a link to learn!!!!!
Nathan Campos