title: "Moving" data structure
body: <p>I am doing an Arduino project with a temperature and humidity sensor and trying to combat data inaccuracy. Every 2 seconds I get 2 values: temperature and humidity. I need some sort of data structure with fixed size where I collect values and when the value count reaches structure size, I begin calculating and outputting the average of those values. Once I get more values than the structure can house, the "oldest" value has to be discarded, present values moved down and new data inserted in front.</p>
  
  <p>What sort of data structure should I use considering the fact, that I need this in C/C++?</p>