Article View: comp.std.c
Article #2009Re: strtol
From: D'Arcy J.M. Cain
Date: Tue, 20 Nov 1990 14:36
Date: Tue, 20 Nov 1990 14:36
17 lines
1033 bytes
1033 bytes
In article <MATTES.90Nov19122748@azu.informatik.uni-stuttgart.de> mattes@azu.informatik.uni-stuttgart.de (Eberhard Mattes) writes:
>Is the behavior of strtol defined in the ANSI standard?
Yes.
>What should
> strtol ("089", NULL, 0)
>return?
It should return 0. Since it is an octal number (based on the leading 0)
the scan stops at the first character not a digit in base 8 which is the
'8' thus the scanned string is "0" and hence 0 is returned.
--
D'Arcy J.M. Cain (darcy@druid) |
D'Arcy Cain Consulting | I support gun control.
West Hill, Ontario, Canada | Let's start with the government!
+ 416 281 6094 |
Technical Details
Message-ID:
<1990Nov20.143643.4178@druid.uucp>Path:
arc1-ca.pugleaf.net!utzoo!telly!druid!darcyReferences:
<MATTES.90Nov19122748@azu.informatik.uni-stuttgart.de>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!utzoo!telly!druid!darcy From: darcy@druid.uucp (D'Arcy J.M. Cain) Subject: Re: strtol Organization: D'Arcy Cain Consulting, West Hill, Ontario Distribution: comp Date: Tue, 20 Nov 90 14:36:43 GMT Message-ID: <1990Nov20.143643.4178@druid.uucp> References: <MATTES.90Nov19122748@azu.informatik.uni-stuttgart.de>