🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

converting a hex string to an int with atoi ?

#4971
From: Peter
Date: Tue, 18 Oct 2005 15:36
13 lines
1402 bytes
using :

int atoi(const char *s);
int _wtoi(const wchar_t *s);

Can this function "understand" hex input and convert it properly ?
E.g. similar to what AnsiString ToInt() can ?
E.g.
String test = "0xFF" ;
int value = test.ToInt() ; // will return a proper value (255)

But with atoi this doesn't work,
is it possible to tell atoi the text input is hex somehow ? 
Technical Details
Message-ID: <435515ce@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!mpls-transit-01.news.qwest.net!38.119.100.82.MISMATCH!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,5978392de90893ce,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Peter" <Will_Bounce_So_Use_My_First_Name@Smart-Projects.net>
From: "Peter" <Will_Bounce_So_Use_My_First_Name@Smart-Projects.net>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: converting a hex string to an int with atoi ?
Date: Tue, 18 Oct 2005 17:36:22 +0200
Lines: 15
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 84.195.111.62
Message-ID: <435515ce@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1129649614 84.195.111.62 (18 Oct 2005 08:33:34 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!mpls-transit-01.news.qwest.net!38.119.100.82.MISMATCH!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail