🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #6144

Re: Another scanf interpretation question

#6144
From: Chris Torek
Date: Thu, 04 Jan 1990 19:12
12 lines
958 bytes
In article <21624@mimsy.umd.edu> I wrote:
>... strtol and strtoul are defined such that they `accept' numbers
>[consisting of only a sign]

Oops: although they return zero, they do not consume the sign, so that
given `strtol("-", &endptr, 0)', *endptr will be '-'.  In effect, they
do not accept numbers consisting of only a sign.

(In other words, the floating point question applies.)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris
Technical Details
Message-ID: <21632@mimsy.umd.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!haven!mimsy!chris
References: <21624@mimsy.umd.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!haven!mimsy!chris
From: chris@mimsy.umd.edu (Chris Torek)
Newsgroups: comp.std.c
Subject: Re: Another scanf interpretation question
Message-ID: <21632@mimsy.umd.edu>
Date: 4 Jan 90 19:12:41 GMT
References: <21624@mimsy.umd.edu>
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
Lines: 12