Accumulator.cpp (228B)
1 #include <stdlib.h> 2 #include "Accumulator.h" 3 4 Accumulator::Accumulator():m_total(0) 5 { 6 } 7 8 void Accumulator::accumulate(const char * data) 9 { 10 m_total += strtol(data, 0, 0); 11 } 12 13 int Accumulator::total() const 14 { 15 return m_total; 16 }