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# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -