//sLine is the string for(int l = 0; l < sLine.length(); l++) { string sNumber; if(sLine[l] == \'-\') { sNumber.push_back(sLine[l]); sN
That seems like a painful way to recreate the wheel. You'd be better off using a stringstream to parse this.
std::stringstream strm(sLine); int num; while(strm >> num) { std::cout << num << std::endl; }