#include #include int main(){ int width, height; unsigned char *pix = SOIL_load_image("chickens.jpg", &width, &height, 0, SOIL_LOAD_RGB); for(int row = 0; row < height/2; row++){ for(int col = 0; col < width*3; col++){ unsigned char temp = pix[width*3*(height-row-1)+col]; pix[width*3*(height-row-1)+col] = pix[width*3*row + col]; pix[width*3*row + col] = temp; } } SOIL_save_image("done.bmp", SOIL_SAVE_TYPE_BMP, width, height, 3, pix); free(pix); return 0; }