From: dbe@wgn.net ($Bill Luebkert)
Subject: Re: scanf "%n" format specifier is not supported
23 Jun 1998 03:34:46 -0700
Message-ID: <358F0208.CB0AC36F.cygnus.gnu-win32@wgn.net>
References: <Pine.GSO.3.96.980622162749.14664D-100000@sigma>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: "gnu-win32@cygnus.com" <gnu-win32@cygnus.com>

Alexander Chernov wrote:
> 
> Hello,
> 
> This looks like a missing feature: "%n" format specifier in sscanf
> is not supported. For example, the following piece of code
> left variable n value as 0 instead of 2. According to my textbooks
> ANSI C specifies %n specifier.
> 
> #include <stdio.h>
> #include <string.h>
> 
>   int
> main()
> {
>   int v = 0, n = 0, r = 0;
> 
>   r = sscanf("32", "%d %n", &v, &n);
>   printf("v = %d\nn = %d\nr = %d\n", v, n, d);
>   return 0;
> }

I would assume this is normal behavior since the %d sucked up the entire 
"32" and left nothing for the %n.

-- 
  ,-/-  __      _  _         $Bill Luebkert
 (_/   /  )    // //       DBE Collectibles
  / ) /--<  o // //      http://www.wgn.net/~dbe/
-/-' /___/_<_</_</_    Mailto:dbe@wgn.net
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
