From owner-freebsd-questions@freebsd.org Tue Apr 26 17:22:52 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 323A5B1D20A for ; Tue, 26 Apr 2016 17:22:52 +0000 (UTC) (envelope-from steve@sohara.org) Received: from uk1mail2513.mymailbank.co.uk (UK1MAIL2513-PERMANET.IE.mymailbank.co.uk [217.69.47.44]) by mx1.freebsd.org (Postfix) with ESMTP id AB9481E78 for ; Tue, 26 Apr 2016 17:22:51 +0000 (UTC) (envelope-from steve@sohara.org) Received: from smtp.lan.sohara.org (UnknownHost [88.151.27.41]) by uk1mail2513-d.mymailbank.co.uk with SMTP; Tue, 26 Apr 2016 18:22:23 +0100 Received: from [192.168.63.1] (helo=steve.lan.sohara.org) by smtp.lan.sohara.org with smtp (Exim 4.86 (FreeBSD)) (envelope-from ) id 1av6gn-000H8o-0h for freebsd-questions@freebsd.org; Tue, 26 Apr 2016 17:22:21 +0000 Date: Tue, 26 Apr 2016 18:22:18 +0100 From: Steve O'Hara-Smith To: freebsd-questions@freebsd.org Subject: Re: c compiling using clang Message-Id: <20160426182218.96e1c8534b9df45f5bcdb709@sohara.org> In-Reply-To: <822D1209-D65C-4F45-A287-A81A7E31EBE1@thehowies.com> References: <822D1209-D65C-4F45-A287-A81A7E31EBE1@thehowies.com> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.29; amd64-portbld-freebsd10.1) X-Clacks-Overhead: "GNU Terry Pratchett" Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 17:22:52 -0000 On Tue, 26 Apr 2016 16:56:29 +0000 John Howie wrote: > Hi Arnab, > > The ‘%’ is the UNIX (FreeBSD) prompt, shown in examples in text books. Do > not type it in. Depending on your shell, and whether or not you are > running as root, you might have $ or # as your prompt instead, or even > something fancier depending on how your profile is setup. > > Just type “cc filename.c” (not the quotes, they are there to highlight > what to type). This will produce a file called a.out. You run that by > typing “a.out” (again, do not type the quotes). If you want to compile > your program to a named file you would type “cc -o myfile filename.c”, > and to run the program just type “myfile”. Just one nit "./a.out" and "./myfile" the current directory is not usually in the path searched for executables. -- Steve O'Hara-Smith