Complete.Org: Mailing Lists: Archives: discussion: February 2000:
[aclug-L] Re: C question
Home

[aclug-L] Re: C question

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: discussion@xxxxxxxxx
Subject: [aclug-L] Re: C question
From: Steven Saner <ssaner@xxxxxxxxxxxxxxx>
Date: Tue, 29 Feb 2000 15:41:31 -0600
Reply-to: discussion@xxxxxxxxx

Use strtok and use all non-integers and the space as the token
delimiters. Then use atoi to convert the resulting strings to
integers.


On Tue, Feb 29, 2000 at 04:25:17PM -0600, Larry Bottorff wrote:
> Let's say I have a buffer full of characters and I want to separate out
> the characters from numbers where consecutive numbers represent a single
> integer. For example: "HELLO OUT THERE 234 I AM NUMBER 8". The 234 and
> the 8 need to be picked out of the array and converted to integer and
> stored as integers. sscanf might work, but then I need to tell the
> buffer index to advance how ever many places the integer takes up in
> order to continue. Building a character array, then convert that string
> to integer seems reasonable, but I can't find a library function for it.
> Any ideas?
> 
> Lars
> 
> -- This is the discussion@xxxxxxxxx list.  To unsubscribe,
> visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi

-- This is the discussion@xxxxxxxxx list.  To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]