A snippet of code from a class project in C++