It immediately exits for some reason?

Code:#include <iostream> #include <string> #include <vector> using namespace std; struct bit { int value; int power; bit *nextbit; bit *prevbit; }; int convert(string bin); int stringToInt(char b); int power(int base, int power); int main() { string bin; cout<<"Binary Number to Convert: "; getline(cin, bin); int baseten = convert(bin); cout<<baseten; cin.get(); } int convert(string bin) { int size = bin.size(); bit *current; vector<bit*> v; for(int i=0; i<size; i++) { current = new bit; v.push_back(current); current->power = i; current->value = 0; } //string bits together for(int i=0; i<size; i++) { current->prevbit=v.at(v.size()-i); current = v.at(v.size()-i); } //string bits together forward for(int i=0; i<size; i++) { current->nextbit = v.at(i); current = v.at(i); } //calculate value for(int i=0; i<size; i++) { v.at(i)->value = stringToInt(bin.at((size-1)-i)); } //final calculation int converted=0; for(int i=0; i<size; i++) { converted += (power(v.at(i)->value, v.at(i)->power)); } return converted; } int power(int base, int power) { if(power == 0) { return base*1; }else{ for(int i=0; i<power; i++) { base *= base; } } return base; } int stringToInt(char b) { if(b == '1') return 1; else if(b=='0') return 0; }

Thanks!