how we can use traceroute

how we can use traceroute in unix c
so how we can get the output of traceroute command in c
thank u,inadvance
sree

You can use popen, system or the exec family of functions to execute the traceroute command through C. The function that you will use however depends on what you want to do with the output of the command. Maybe you could spell out exactly what you are trying to do.

thank u for ur reply,i want to know whether net connection is enable or not without ping.
so tried this traceroute in command prompt it's working fine so i wan t to implement in code.

how we can get the gateway address.
i know gethostname used for ipaddress
how we can get the system gateway address.
thank u inadvance,
sree