C and C++ versions