Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Dec 2006 07:24:48 -0800 (PST)
From:      linux quest <linuxquest7570@yahoo.com>
To:        FreeBSD-questions@FreeBSD.org
Subject:   How to compile first network program? E.g. to PING google.com
Message-ID:  <978214.91301.qm@web59208.mail.re1.yahoo.com>

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 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 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?978214.91301.qm>