C Program to get IP Address, Subnet Mask, Default Gateway

This video tutorial explains how we write a c program to get the ip address, subnet mask and default gateway using system() and execl() functions.
You will learn how to use system and execl function to execute ipconfig program in windows os which displays the ip address, subnet mask and default gateway in detail with example.



Source code for this video tutorial

#include <stdio.h>
#include <stdlib.h>

int main()
{

//system("c:\\windows\\system32\\ipconfig");
execl("c:\\windows\\system32\\ipconfig","ipconfig",0);

    return 0;
}