From owner-freebsd-questions@FreeBSD.ORG Fri Dec 29 15:24:50 2006 Return-Path: X-Original-To: FreeBSD-questions@FreeBSD.org Delivered-To: FreeBSD-questions@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1222C16A407 for ; Fri, 29 Dec 2006 15:24:50 +0000 (UTC) (envelope-from linuxquest7570@yahoo.com) Received: from web59208.mail.re1.yahoo.com (web59208.mail.re1.yahoo.com [66.196.101.34]) by mx1.freebsd.org (Postfix) with SMTP id B6FCD13C428 for ; Fri, 29 Dec 2006 15:24:49 +0000 (UTC) (envelope-from linuxquest7570@yahoo.com) Received: (qmail 91580 invoked by uid 60001); 29 Dec 2006 15:24:49 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=e/F+VByUCj8beymF5+Gn7hxj28jSoFF+Cu11rItZk8RuoDeTQY3K6HXIOS9ZxVSSCCH13FPUovcj5tMif85uYz6l61tS3DBEYPKqE3vJavDwTgJ/aUy9Xhr6+Xa36T9nFUfORWylRfaL9CXltUzLaQCr7wNHcObNlUk4/VRBCAo=; X-YMail-OSG: SKXq6L0VM1kP_p5xDXEuPTNjVR3M5_.iMj2UCsoemm6B2.w77HT17hyPjvzBfkPL0JTUawa63uQ19CHdfsejqWtJA4rI1ryxZmy0JHrmmMjWCsiBkc0D6aIk50dYnpliJC65Aqjl0HwCQUYJCnnsjwfMu6XAH1s_8X7j4IJfbRUT Received: from [60.48.198.209] by web59208.mail.re1.yahoo.com via HTTP; Fri, 29 Dec 2006 07:24:48 PST Date: Fri, 29 Dec 2006 07:24:48 -0800 (PST) From: linux quest To: FreeBSD-questions@FreeBSD.org MIME-Version: 1.0 Message-ID: <978214.91301.qm@web59208.mail.re1.yahoo.com> X-Mailman-Approved-At: Fri, 29 Dec 2006 15:52:36 +0000 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: How to compile first network program? E.g. to PING google.com X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Dec 2006 15:24:50 -0000 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