c++ - Convert a string with various float numbers into floats. -


i have series of strings "50 50 10"

each number supposed represent x, y, , z values of origin. want convert each number of string actual float.

i tried using atof, gave me first number, 50 in case.

any ideas?

thank you!

use istringstream,

int main() {      string s = "50 50 50";      istringstream instream;     instream.str(s);      double a, b, c;     instream >> >> b >> c;     return 0; } 

Comments

Popular posts from this blog

c# - Attribute value in root node of xml Linq to XML -

android - Retrieve value from radioButtons in alertDialog -

mongodb - Struggling to get ordered results from the last retrieved article, given array of elements to search in -