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: ACLUG <discussion@xxxxxxxxx>
Subject: [aclug-L] Re: C question
From: Jeff <schaller@xxxxxxxxxxxxx>
Date: Tue, 29 Feb 2000 15:40:01 -0600 (CST)
Reply-to: discussion@xxxxxxxxx

You could loop over it yourself and if you see a digit (isdigit
(ctype.h)), start saving it. If you see something that's not  a
digit, save what you saw so far and start again.

You could use sscanf(%d %s) and check the return code; loop over
the remaining %s for future sscanf's.

you could use *shiver* strtok

you could use  an ugly strchr('0') || strchr('1') | ...

you could use perl: @numbers = $string =~ /(\d+)/g;
wow wasn't that easy.
You could tell perl to compile that and hand that in ...

-jeff

-- 
              /"\
              \ /     ASCII RIBBON CAMPAIGN
               X        AGAINST HTML MAIL
              / \



-- 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]