Re: String to Octal
- From: Ben Pfaff <blp@xxxxxxxxxxxxxxx>
- Date: Mon, 20 Feb 2006 20:44:58 -0800
fuch6921@xxxxxxxxxxxxx writes:
I want to read in an Octal number argument and have it stored as an
octal number. For instance the user will type: ./a.out 777 and it
will store the octal number 777. But it atoi does this as an interger,
and sscanf gives me 0.
Use strtol(), specifying base 8.
--
"I've been on the wagon now for more than a decade. Not a single goto
in all that time. I just don't need them any more. I don't even use
break or continue now, except on social occasions of course. And I
don't get carried away." --Richard Heathfield
.
- References:
- String to Octal
- From: fuch6921
- String to Octal
- Prev by Date: Re: how to print it out
- Next by Date: Re: Seriously struggling with C
- Previous by thread: Re: String to Octal
- Next by thread: Re: String to Octal
- Index(es):
Relevant Pages
|