This code I'm writing for one of my classes will not print what it's written to. I've asked around and nobody can figure it out. Could it be something relating to the vectors or any strings? The furthest cout will work is where I print out the inputted command line arguments. When compiled on cygwin, it doesn't run into any errors that it can print out.
#include <iostream>
#include <sstream>
#include <vector>
#include <cmath>
using namespace std;
int main(int argc, char *argv[])
{
//declare variables
string possibleValues;
string number;
int inBase;
int numLength;
int outBase;
int outcome;
int baseTenTemp;
vector<int> placeHolder;
vector<int> finalTranslator;
//turn base strings into integers
baseTenTemp = 0;
possibleValues = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
istringstream(argv[1]) >> inBase;
istringstream(argv[3]) >> outBase;
number = argv[2];
cout << "inBase is " << inBase << " outBase is " << outBase << " and number is " << number << endl;
//nothing beyond this point prints...
//convert number into an int vector
numLength = number.length();
for(int i = 0; i<numLength; i++)
{
for(int j = 0; j <possibleValues.length(); j++)
{
if(number.substr(i,i++)==possibleValues.substr(j,j++))
{
placeHolder.push_back(j);
}
}
}
cout << "will this print?" << endl; //nope
//convert number into base ten
for(int i = 0; i < numLength; i++)
{
baseTenTemp = baseTenTemp + (placeHolder.at(i)*pow(inBase,numLength-i));
}
cout << baseTenTemp << endl;
//convert base ten number into outBase number
while(baseTenTemp>0)
{
finalTranslator.push_back(baseTenTemp%outBase);
baseTenTemp=baseTenTemp/outBase;
}
//print converted number
for(int i = finalTranslator.size()-1; i >=0; i--)
{
cout << finalTranslator.at(i);
}
cout << "checker" << endl;
return 0;
}