Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jun 2009 13:11:21 -0500
From:      "Rick C. Petty" <rick-freebsd2008@kiwi-computer.com>
To:        Alexander Best <alexbestms@math.uni-muenster.de>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: c question: *printf'ing arrays
Message-ID:  <20090630181121.GA32665@keira.kiwi-computer.com>
In-Reply-To: <permail-20090630180321f7e55a9d00002466-a_best01@message-id.uni-muenster.de>
References:  <a2b6592c0906301100g55827437o66e09d6ca1269cdd@mail.gmail.com> <permail-20090630180321f7e55a9d00002466-a_best01@message-id.uni-muenster.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jun 30, 2009 at 08:03:21PM +0200, Alexander Best wrote:
> should be stdout.
> 
> 
> struct Header *hdr = rom;
> 
> int new_fd = open("/dev/stdout", O_RDWR);
> printf("SIZE: %d\n",sizeof(*hdr));
> write(new_fd, hdr, sizeof(*hdr));
> close(new_fd);

Why are you reopening stdout?  It should already be open, so use
"fileno(stdout)" or just plain "STDOUT_FILENO" instead of "new_fd".

-- Rick C. Petty



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