recentpopularlog in

kme : vector   26

C++ STL List calculate average - Stack Overflow
NB: This is uncorrected. The first accepted solution has a couple of fixes.

double MyClass::CalculateAvg(const std::list<double> &list)
{
double avg = 0;
std::list<int>::iterator it;
for(it = list->begin(); it != list->end(); it++) avg += *it;
avg /= list->size();
}
cplusplus  iterator  programming  vector  maybesolution 
april 2013 by kme
typedef a vector of fixed size - General Programming - GameDev.net
You can't do this on a typedef with a vector:

typedef vector<int>* MyThing[DEFAULT_THING_SIZE];

Have to adjust the size within a class constructor instead.
cplusplus  vector  programming  tipsandtricks  dammitbrain 
april 2013 by kme

Copy this bookmark:





to read