A program that simulates DM and SA caches in C++