From owner-freebsd-questions Wed Jan 12 23:30: 4 2000 Delivered-To: freebsd-questions@freebsd.org Received: from linux.ssc.nsu.ru (linux.ssc.nsu.ru [193.124.209.130]) by hub.freebsd.org (Postfix) with SMTP id D93CC154F2 for ; Wed, 12 Jan 2000 23:29:45 -0800 (PST) (envelope-from danfe@ssc.nsu.ru) Received: (qmail 30058 invoked from network); 13 Jan 2000 07:29:16 -0000 Received: from inet.ssc.nsu.ru (62.76.110.12) by hub.freebsd.org with SMTP; 13 Jan 2000 07:29:16 -0000 Received: from localhost (danfe@localhost) by inet.ssc.nsu.ru (8.9.3/8.9.3) with ESMTP id NAA32608 for ; Thu, 13 Jan 2000 13:28:57 +0600 Date: Thu, 13 Jan 2000 13:28:57 +0600 (NOVT) From: "Alexey N. Dokuchaev" To: freebsd-questions@FreeBSD.ORG Subject: (void)printf(); (Was: Re: simple c i/o question) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 12 Jan 2000, Naief BinTalal wrote: > On Wed, Jan 12, 2000 at 04:28:23PM +0000, Jonathon McKitrick wrote: > > > > I'm trying to write a hello world program. What is the output file for > > the console currently being displayed (in other words, the screen)? > > I've tried printf, and fprintf to stdout and stderr. > > #include > > int > main(void) > { > (void)fprintf(stdout,"Hello World\n"); > return 0; > } > While browsing thru the source code of almost anything in FreeBSD, I've noticed that (type)function(parameters); syntax. Why not just to write function(paramenters). Like in the prev example, what's wrong with simple printf(blahblah); but (void)printf(blahblah); ? Thanx. ,--------------------------------------, ____ ___ _______ | Alexey N. Dokuchaev, more commonly | / __/______ ___ / _ )/ __/ _ \ | known as DAN Fe | / _// __/ -_) -_) _ |\ \/ // / | | /_/ /_/ \__/\__/____/___/____/ | Novosibirsk State University `-------- The Power to Serve --------, | Scientific Study Center Computer Lab | | | | email: danfe@inet.ssc.nsu.ru homepage: http://inet.ssc.nsu.ru/~danfe/ | | ICQ UIN: 38934845 | `---------------------------------------------------------------------------' A good conspiracy is unprovable. I mean, if you can prove it, it means they screwed up somewhere along the line. Jerry Fletcher from Conspiracy Theory To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message