mercredi 20 février 2019

C++ put results from parser to array

I'm new in C++.

I'd like to know how can I parse a string and put result in an array.

So, imagine I have a string like this: 104.8 10.9 7.8e-33 2.6e-29 59 248 .. 46 230 .. 20 336 .. 0.87

It is always the same stile, it means, 14 non [:space:] separated by variable number of spaces between then.

I'd like to parse using regex and put this values within an array. Since we know how many matches we can set the array to length 14 char array[14];

Thanks in advance for any help.

Aucun commentaire:

Enregistrer un commentaire