comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: problems with interfacing c
Date: Fri, 28 Jan 2011 06:24:53 +0100
Date: 2011-01-28T06:24:53+01:00	[thread overview]
Message-ID: <op.vpz6nrqeule2fv@garhos> (raw)
In-Reply-To: 85c958cc-8cd3-46be-b14d-3519ff207d87@b8g2000vbi.googlegroups.com

Le Fri, 28 Jan 2011 01:39:50 +0100, Stoik <staszek.goldstein@gmail.com> a  
écrit:
> Thanks for your suggestions and comments. The point is that I am sending
> a solution to a problem to a site managing programming contests, and the  
> stdin
> is in fact redirected to some text file with data. I do not know how
> big the data file will be, I know only the upper limit. Quick reading of 
> the data is the key to success, and the two lines of C work very well for
> the purpose. I have not tried your solution, is it not going to cause
> constraint_error when it meets the end of the file?
Why not simply get the file size before reading its content ? You seem to  
suggest you have to read from the file, not from the standard input  
stream, so should be OK (that's a very strange contest this one… the  
execution speed will more depend on runtime and platform than to your art).

> The other question is - how to use the C bindings properly in such a
> case?
For that purpose, there is no good way, because this is ... heuu... stupid  
(oops). There may be proper ways to bind to something else, not to this.

-- 
Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
les chiens.

“I am fluent in ASCII” [Warren 2010]



  reply	other threads:[~2011-01-28  5:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20 20:21 problems with interfacing c Stoik
2011-01-20 20:56 ` Dmitry A. Kazakov
2011-01-20 21:31   ` Yannick Duchêne (Hibou57)
2011-01-20 23:03     ` Dmitry A. Kazakov
2011-01-21  0:46       ` Yannick Duchêne (Hibou57)
2011-01-21  9:33         ` Dmitry A. Kazakov
2011-01-28  0:39   ` Stoik
2011-01-28  5:24     ` Yannick Duchêne (Hibou57) [this message]
2011-01-28  9:41     ` Ludovic Brenta
2011-01-28  9:44     ` Dmitry A. Kazakov
2011-01-31 21:46       ` Stoik
2011-01-31 23:06         ` Edward Fish
2011-02-01  8:48         ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox