strtol
D'Arcy J.M. Cain
darcy at druid.uucp
Wed Nov 21 01:36:43 AEST 1990
In article <MATTES.90Nov19122748 at azu.informatik.uni-stuttgart.de> mattes at 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 at druid) |
D'Arcy Cain Consulting | I support gun control.
West Hill, Ontario, Canada | Let's start with the government!
+ 416 281 6094 |
More information about the Comp.std.c
mailing list