How to display the IP address of a local computer in Windows with C++

1 Answer

0 votes
#include <iostream>

int main(void)
{
    system("C:\\Windows\\System32\\ipconfig");
}



/*
run:

Windows IP Configuration


Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : ab71::9821:fs10:1234:9846:ab:u812:7x
   Temporary IPv6 Address. . . . . . : ab71::9821:fs10:1234:9846:ab:u812:7x
   Temporary IPv6 Address. . . . . . : ab71::9821:fs10:1234:9846:ab:u812:7x
   Temporary IPv6 Address. . . . . . : ab71::9821:fs10:1234:9846:ab:u812:7x
   Temporary IPv6 Address. . . . . . : ab71::9821:fs10:1234:9846:ab:u812:7x
   Temporary IPv6 Address. . . . . . : ab71::9821:fs10:1234:9846:ab:u812:7x
   Link-local IPv6 Address . . . . . : av61::3c5a:ceac:f21f:3c41%7
   IPv4 Address. . . . . . . . . . . : 151.251.5.71
   Subnet Mask . . . . . . . . . . . : 255.255.255.255
   Default Gateway . . . . . . . . . : av61::3c5a:ceac:f21f:3c41%7
                                       231.201.5.5

*/

 



answered Jan 4 by avibootz
edited Jan 8 by avibootz

Related questions

1 answer 197 views
1 answer 145 views
1 answer 225 views
225 views asked Apr 8, 2014 by avibootz
1 answer 229 views
...