How to get IP Address?

Started by
2 comments, last by hplus0603 17 years, 4 months ago
Hi, everybody! Can you tell me how to get ip address and subnet mask of my own computer? I need it to send broadcast message... I use Microsoft Visual C++ 6.0 and Winsock 2. Thanx :)
Advertisement
I think the getaddrinfo function is what you are looking for. You can look it up on MSDN. I'm not sure if it can give you the subnet mask, though...
Ok.

Thanx for your reply!

:)
The Forum FAQ talks about how to get your local address -- and why it's a bad idea.

To send a broadcast message, you can send it to 255.255.255.255, and it will still be filtered to the local subnet.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement