views:

162

answers:

0
+1  Q: 

Segmentation Fault

I'm getting a segmentation fault on this statement, when I comment it out I don't get a segfault:

this->rows += 1;

The whole method is like so:

template <class T> void Table<T>::push_back_row(std::vector<T> & vec){
  //Create a new row structure
  T ** temp;
  temp = new T*[this->rows+1];

  for(uint i = 0; i < rows; i++){
    //Reset the original rows in the new table layout
    *(temp+i) = *(values+i);
  }
  this->rows += 1;
}

and uint is typdefed to unsigned int