Hello, I have this simple doubt: what's the code more properly?And Why?(my question is on the vector "vec") thanks.
Qt Code:
  1. string str;
  2. while(file.getline(str)) {
  3. vector<int> vec;
  4. ..................
  5. while (parseStr) {
  6. vec.push_back(numberContainedInStr);
  7. }
  8. otherVector.push_back(vec);
  9. }
To copy to clipboard, switch view to plain text mode 
or
Qt Code:
  1. string str;
  2. vector<int> vec;
  3. while(file.getline(str)) {
  4. ..................
  5. while (parseStr) {
  6. vec.push_back(numberContainedInStr);
  7. }
  8. otherVector.push_back(vec);
  9. vec.clear();
  10. }
To copy to clipboard, switch view to plain text mode