🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2872

Re: scanf %x allows leading 0x?!?

#2872
From: Stephen Clamage
Date: Sat, 11 May 1991 19:36
15 lines
1031 bytes
scjones@thor.sdrc.com (Larry Jones) writes:

|I was just surprised to discover that the %x conversion specifier
|used in the *scanf functions allows the target string to have a
|leading 0x or 0X.  I don't remember any discussion about it and a
|few quick tests show about a 50/50 split of systems that allow it
|and systems that don't.  Was that behavior specified in the SVID
|or /usr/group specs, was it picked up from somewhere else, or is
|it just an unaticipated feature?

It is the explicitly-specified behavior in ANSI C.  On systems which
do not follow the ANSI standard, you may get different behavior.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Technical Details
Message-ID: <725@taumet.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!taumet!steve
References: <161@thor.sdrc.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!taumet!steve
From: steve@taumet.com (Stephen Clamage)
Newsgroups: comp.std.c
Subject: Re: scanf %x allows leading 0x?!?
Message-ID: <725@taumet.com>
Date: 11 May 91 19:36:26 GMT
References: <161@thor.sdrc.com>
Organization: Taumetric Corporation, San Diego
Lines: 15