A circular buffer is essentially just an array that when you get to the end of the array, you start writing at the beginning again. You'll need something to keep track of your current position, the length of the array, and something to keep track of the last read position (to prevent overwrite, if neccessary).

I'll leave the implementation up to you, as this sounds a bit like a homework problem.