/ Forside / Teknologi / Udvikling / C/C++ / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
C/C++
#NavnPoint
BertelBra.. 2425
pmbruun 695
Master_of.. 501
jdjespers.. 500
kyllekylle 500
Bech_bb 500
scootergr.. 300
gibson 300
molokyle 287
10  strarup 270
Reading numbers from AnsiStrings .. how ?
Fra : Peter Smith


Dato : 10-05-01 22:16

Hi,

Sorry for my missing danish, anyway I hope it's okay with you guys

It seems like I lack knowledge of string handling. I am dealing with an
AnsiString consisting of number values (like e.g. " 1.23 4.5573 5.223E+8
and might be some text here ");

I would like a tip for the easiest way of putting the numbers in e.g. a
double array, i.e. like (simplified):

double val[3];

AnsiString StringWithNumbers = " 1.23 4.5573 5.223E+8 and might be some
text here ";

AnsiString ValString;

for (int i=0; i<3; i++)
{
//read StringWithNumbers - your code would be pleased here

val[i] = ValString.ToDouble;

}


(using the for-loop and the substring "ValString" is just my idea on how to
attack the problem, please feel free to use your creativity

NB: I do read danish, so please feel no hesitation here in answering me

Kind regards,
Peter Smith

 
 
Søg
Reklame
Statistik
Spørgsmål : 177501
Tips : 31968
Nyheder : 719565
Indlæg : 6408522
Brugere : 218887

Månedens bedste
Årets bedste
Sidste års bedste