You can create a ‘target texture’ (separate from the backbuffer) to which all your rendering is done. Then, once a frame, you copy that texture to the backbuffer. So your updateScreen
function becomes:
SDL_SetRenderTarget(renderer, NULL);
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_RenderClear(renderer);
SDL_RenderCopy(renderer, texture, NULL, NULL);
SDL_RenderPresent(renderer);
SDL_SetRenderTarget(renderer, texture);
Now you can change just one pixel (or none) each frame.