From: micha <micha-1@fantasymail.de>
To: caml-list@inria.fr
Subject: 3.10 changes for scanf
Date: Thu, 22 Mar 2007 11:56:24 +0100 [thread overview]
Message-ID: <20070322115624.7f1a04f7@localhost> (raw)
I have a file with one int per line and when reading it with:
let x = (Scanf.fscanf log "%d" (fun n -> n)) in
let y = (Scanf.fscanf log "%d" (fun n -> n)) in
let w = (Scanf.fscanf log "%d" (fun n -> n)) in
let h = (Scanf.fscanf log "%d" (fun n -> n)) in
....
it works in 3.09, but 3.10 fails with:
Exception: Scanf.Scan_failure "scanf: bad input at char number 1: \n"
so I must change the format string to " %d " (note the spaces around
%d) to eat the newline too, is this a desired change?
( the c version reads the numbers with just "%d", I'm not sure what's
the correct behavior)
cheers,
Michael
reply other threads:[~2007-03-22 10:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070322115624.7f1a04f7@localhost \
--to=micha-1@fantasymail.de \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox