comp.lang.ada
 help / color / mirror / Atom feed
From: "J.s" <justin.squirek@gmail.com>
Subject: Does ada have a sscanf equivalent?
Date: Mon, 22 Feb 2010 01:08:45 -0800 (PST)
Date: 2010-02-22T01:08:45-08:00	[thread overview]
Message-ID: <5e46b3e8-f7ea-45a6-a884-6882f6ec8295@c16g2000yqd.googlegroups.com> (raw)

I am trying to translate some C code that parses a string into numbers
(both Integers and Floats) from an input file. Would it be easiest to
just import the C function or is there an Ada equivalent? (I found a
package but I don't think I understand how it works:
http://www.web-port.net/Christfried.Webers/sources/flex/s-valrea__ads.htm)

Input file:
        . . .
	vert 7 0.4453125 0.416015625 9 1
	vert 8 0.453125 0.517578125 10 1
	vert 9 0.39453125 0.513671875 11 1
        . . .
C code:
        . . .
   if (sscanf (buff, "%s %d ( %f %f %f ) ( %f %f %f )",
     joint->name, &joint->parent, &joint->pos(0),
     &joint->pos(1), &joint->pos(2), &joint->orient(0),
     &joint->orient(1), &joint->orient(2)) == 8){
        . . .



             reply	other threads:[~2010-02-22  9:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-22  9:08 J.s [this message]
2010-02-22 10:24 ` Does ada have a sscanf equivalent? Georg Bauhaus
2010-02-22 10:42 ` Jacob Sparre Andersen
2010-02-22 15:38   ` J.s
2010-02-22 19:48 ` jpwoodruff
2010-02-22 23:11   ` Jerry
2010-02-23  2:11     ` jpwoodruff
2010-02-23  9:36       ` Conversion from Ada95 to Ada05 (Was: Does ada have a sscanf equivalent?) stefan-lucks
2010-02-23 19:48         ` Randy Brukardt
2010-02-23 21:12           ` Conversion from Ada95 to Ada05 Robert A Duff
replies disabled

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