How to save data in a buffer in Arduino

If you have an interrupt that is used to count frequency, how would suggest one do the buffer for higher frequencies?