[Dev-C++] How to convert numbers in string format to a vector
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Rodrigo C. <rc...@gm...> - 2005-12-23 21:37:12
|
Hi C++ gurus: hope you have a nice Xmas! I want to convert a string that cointains numbers separated by spaces (or other characters) to a vector or array containing the numbers, like: "0 1 0 3 4 0 5 0" =3D> [0 1 0 3 4 0 5 0] or "0,1,2,4,6,7" =3D> [0 1 2 4 6 7] The number of colums (number of numbers) of each string is unknown. How can I do this using C++ strings? Thanks. Rodrigo F. Cadiz rc...@gm... |