Link to home
Start Free TrialLog in
Avatar of Batalf
BatalfFlag for United States of America

asked on

handling a string

Hi

I have a textfile containing text and numbers, like this :

Abc 34yfg 690
5 90 8
1

What I need is a short function on how to extract the numbers from this text and add them together.

The text above = 34 + 690 + 5 + 90 + 8 +1

ASKER CERTIFIED SOLUTION
Avatar of graham_k
graham_k

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KangaRoo
KangaRoo

There is a simple function to test if a character is a digit, int isdigit(int thechar).