some frequently used c++ functions