Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Dec 2006 07:24:48 -0800 (PST)
From:      linux quest <>
Subject:   How to compile first network program? E.g. to PING
Message-ID:  <>

Next in thread | Raw E-Mail | Index | Archive | Help

May I know how do I write a simple C network program in UNIX FreeBSD? I have bought some UNIX Network Programming books, but the problem is, the book straight away jump into some complex program - without showing how to compile and execute a simple program in the correct location in UNIX. I even did some searches online, which eventually lead me to this particular article at - but this article still doesn't show me how to compile a simple C program.

I know a bit about echoing a Hello World by simply typing the following:-

abc# echo "Hello World!"
Hello World!

So, my question is ... 

1.    How can I write a very simple C network program ... to lets say I wanted to ping ??? 

2.    Which directory / location in UNIX should I go to? 

3.    How do I compile and execute the simple C network program - lets say doing a ping on

Thanks for any help.

Linux Quest

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

Want to link to this message? Use this URL: <>