You are viewing a single comment's thread. Return to all comments →
however in the main there is a mem leak:
class Student { private: std::vector<int> m_scores; int m_sum; public: Student() : m_scores(5,0), m_sum(0) {} ~Student(){} inline void input() { for(auto &it:m_scores) { int temp; std::cin>> temp; it = temp; m_sum += temp; } } const int& calculateTotalScore()const { return m_sum; } };
Seems like cookies are disabled on this browser, please enable them to open this website
Classes and Objects
You are viewing a single comment's thread. Return to all comments →
however in the main there is a mem leak: