[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sscanf
From: |
Dimitri Maziuk |
Subject: |
sscanf |
Date: |
Fri, 16 Nov 2012 15:26:14 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.10) Gecko/20121030 Thunderbird/10.0.10 |
Can anyone explain why, given the input string
1 M HE 2.140
[row, cnt, err] = sscanf( "%4d %1s %4s %8.3f", str )
row
fails with "error: sscanf: invalid format specified"
whereas
[row, cnt, err] = sscanf( "%d %s %s %f", str )
row
prints
row =
1.0000
77.0000
72.0000
69.0000
2.1400
...
(and yes, I know what 77, 72, and 69 are, that's not the question)
TIA
--
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu
signature.asc
Description: OpenPGP digital signature
- sscanf,
Dimitri Maziuk <=