🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14363

Re: strtol question.

#14363
From: Alan Bellingham
Date: Mon, 18 Aug 2003 15:15
15 lines
1645 bytes
"MWP" <mwp@overclockers.com.au> wrote:

>It seems like this is a decent way of checking:
>
>v = strtol(value, &end, 0 );
>if((end-value) != strlen(value))
>   // not a valid number

That's an alternative, yes. It has a slightly different meaning, since
it'll fail " 27 ", whereas mine shouldn't (well, bugs aside). Whether
that's a problem or an advantage is your decision.

Alan Bellingham
-- 
alanb@episys.com
Technical Details
Message-ID: <e8r1kvk99jiss59meeqsk9m40ntnd1pber@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!216.170.153.135.MISMATCH!tdsnet-transit!newspeer.tds.net!news-out1.nntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f40b30b$1@newsgroups.borland.com> <3f40c083$1@newsgroups.borland.com> <eqi1kvk5265bh6ocgr2p8i934dt2einqvd@4ax.com> <3f40e6c3$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,ecc2b4647792de18
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-18 08:42:41 PST
From: Alan Bellingham <alanb@episys.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: strtol question.
Date: Mon, 18 Aug 2003 16:15:51 +0100
Reply-To: alanb@episys.com
Message-ID: <e8r1kvk99jiss59meeqsk9m40ntnd1pber@4ax.com>
References: <3f40b30b$1@newsgroups.borland.com> <3f40c083$1@newsgroups.borland.com> <eqi1kvk5265bh6ocgr2p8i934dt2einqvd@4ax.com> <3f40e6c3$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.92/32.572
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 193.129.251.130
X-Trace: newsgroups.borland.com 1061219773 193.129.251.130 (18 Aug 2003 08:16:13 -0700)
Lines: 15
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!216.170.153.135.MISMATCH!tdsnet-transit!newspeer.tds.net!news-out1.nntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail