From: anon@anon.org (anon)
Subject: Re: newline in a simple program
Date: Wed, 19 Dec 2007 04:35:31 GMT
Date: 2007-12-19T04:35:31+00:00 [thread overview]
Message-ID: <nc1aj.59082$MJ6.55181@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: M1P9j.7718$wy2.3046@edtnps90
--
--
-- GNAT.IO and "System.IO" uses the "printf"
--
-- "Ada.Text_IO" uses "fprintf" because it is based on file stucture.
-- Since this package uses files it must closed and
-- the core library routine adds a NL character during
-- the closing process.
--
with Ada.Text_IO ;
with GNAT.IO ;
with System.IO ;
procedure y is
begin
Ada.Text_IO.Put ( "Testing NL" ) ;
GNAT.IO.Put ( "Testing NL" ) ;
System.IO.Put ( "Testing NL" ) ;
Ada.Text_IO.Put_Line ( "DONE" ) ;
end y ;
In <M1P9j.7718$wy2.3046@edtnps90>, Paul <duneo@telus.net> writes:
>Hi, given the following two simple programs
>
>
>hello.adb
>-----------------------
>with ada.text_io;
>procedure hello is
>begin
>ada.text_io.put("hello");
>end hello;
>-----------------------
>
>
>hello.c
>-----------------------
>#include <stdio.h>
>int main()
>{
> printf("hello");
>}
>-----------------------
>
>the result for the ada program is:
>-----------------------
>$ ./hello_in_ada
>hello
>$
>-----------------------
>
>and for the c program:
>-----------------------
>$ ./hello_in_c
>hello$
>-----------------------
>
>The c program does not print a new-line, but the ada program does.
>
>Is there any way to make the ada program not print a new-line?
>
>And is this behavior part of the Ada standard or is it just part of gnat?
>
>I looked for answers, but found none.
>
>Thanks,
>
>Paul Zacharzewski
next prev parent reply other threads:[~2007-12-19 4:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-18 12:28 newline in a simple program Paul
2007-12-18 12:48 ` petter_fryklund
2007-12-18 13:11 ` Dmitry A. Kazakov
2007-12-18 13:45 ` petter_fryklund
2007-12-18 13:59 ` Dmitry A. Kazakov
2007-12-18 14:13 ` Brian Drummond
2007-12-18 14:49 ` petter_fryklund
2007-12-18 19:40 ` Jeffrey R. Carter
2007-12-18 16:44 ` Adam Beneschan
2007-12-19 4:35 ` anon [this message]
2007-12-19 11:43 ` Paul
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox