Use sstream;
#include<sstream>
#include<string>
using namespace std;
int main(){
stringstream converter;
string str= "3.14";
converter << str ; //put in string
float PI = 0;
converter >> PI; //put out float
return 0;
}
Reputation Points: 840
Solved Threads: 594
Senior Poster
Offline 3,865 posts
since Dec 2008