#include #include #include float str_to_float(char* s) { istrstream tmp(s, strlen(s)); float ans; tmp >> ans; return(ans); } int main() { char *s = "3 -3.1 \t 3.1416"; cout << s << "\n"; int a; float b, c; istrstream tmp(s, strlen(s)); tmp >> a >> b >> c; // istrstream (s, strlen(s)) >> a >> b >> c; cout << a+b+c << "\n"; return(0); }