EXC Bad Access on conversion to string

#include <iostream>
#include <string>
#include <sstream>
#include <vector>

using namespace std;

int product();
vector<int> splitter();
vector<int> sequence();


int charToInt(char ch);
template <class T>
string toString(T num);
template <class T>
void printVector(const vector<T>& v);

template <typename T>
void vectorPrint(const vector<T> &list) {
for (T item : list) {
cout << item << " ";
}
}



// convert a char digit '0'..'9' to int
int charToInt(char ch) {
return ch - '0';
}

// Put your class here
class Numbas {

private:
int number{1};



public:

Numbas(int num){

if (num < 1) {
number = 1;
}
else{
number = num;
}
}

int getNumber(){
return number;

}

void setNumber(int x){

if (x < 0) {
number = 1;
}
else {
number = x;
}
}



vector<int> splitter(){


string strin = to_string(number); // this is where the exc error is being thrown

for (int i {0} ; i < strin.length(); i++) {


int conversion = charToInt(strin[i]);

if (conversion > 0){
splitter().push_back(conversion);
}

}
return splitter();

}
Any help with this is greatly appreciated ! Thanks
bump
Please use code tags http://www.cplusplus.com/articles/z13hAqkS/

Make sure you indent your code.

Also provide a complete program (something we can compile) that demonstrates the problem.

If you have compiler warnings or errors, then post them here in full, verbatim.

Set a high level of warnings: http://www.cplusplus.com/forum/general/183731/#msg899203

If you do these things you are much more likely to get a reply.
Hey thanks for the help ! I resubmitted my issue at http://www.cplusplus.com/forum/general/211822/ :D
Topic archived. No new replies allowed.