add oop simulation in C