C Programming Code to Get IP Address

Configurare noua (How To)

Situatie

To find or get the IP address in C programming, use system() function and place the command inside it to find or get the IP address.

Solutie

Pasi de urmat
/* C Program - Get IP Address */

#include<conio.h>
#include<stdlib.h>
void main()
{
clrscr();
system("C:\\Windows\\System32\\ipconfig");
getch();
}

When the above c program is compile and executed, it will produce the following result:

c program to get ip address

You can also check it out from SOURCE folder instead of BIN folder (inside SOURCE folder, you can find your program name, click on that to watch the output that will be about your ip address, sample of the output is listed below). This is for “Turbo C” users. Above C Programming Example Output (lower part of output):

find ip address using c programming

Above C Programming Example Output (upper part of output):

get ip address using c programming

Above C Programming Example Output (full part of output):

get ip address in c programming

Tip solutie

Permanent

Voteaza

(8 din 14 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?