c and C++ image