Vector<string> in double!

Im writing an calculator which is able to handle with sin, cos, PI, ...
I wrote one string vector which stores the numbers and functions(sin, ...) and one string vector which stores the +, *, / and -.
But I have no idea how to transform my string vectors into double numbers...

[code]
#include <iostream>
#include <vector>
#include <string>
#include <math.h>

using namespace std;
string abfrage;

int main(){
do{
unsigned int anzahlOperanden;

cout << "Wieviele Operanden werden Sie verwenden? ";
cin >> anzahlOperanden;
cout << endl;

vector<string> zahlen;
vector<string> rechenzeichen;
unsigned int zaehler = 0;
string x;
string c;

for (int i = 1; i < anzahlOperanden*2; i++){
unsigned short ordnen;
ordnen = i % 2;
string x;
string c;

if (ordnen == 1){
zaehler = zaehler + 1;
cout << "Bitte geben Sie den " << zaehler << ".Operanden ein: ";
cin >> x;
cout << endl;
zahlen.push_back(x);
}
else if (ordnen == 0){
cout << "Bitte geben Sie ein Rechenzeichen ein: ";
cin >> c;
cout << endl;
rechenzeichen.push_back(c);
}
}



cout << "Soll eine weitere Aufgabe berechnet werden? (j/n)" ;
cin >> abfrage;
}while(abfrage == "j");

cin.sync();
cin.clear();
cin.get();

return 0;
}
Topic archived. No new replies allowed.