How to compile first network program? E.g. to PING google.com

linux quest linuxquest7570 at yahoo.com
Fri Dec 29 07:24:50 PST 2006



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 http://www.faqs.org/faqs/unix-faq/socket/ - 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!
abc# 

So, my question is ... 

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

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 google.com???

Thanks for any help.

Regards,
Linux Quest


 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the freebsd-questions mailing list