I want to output a pixel on the screen by directly accessing the video memory. How do I do that in C ?
Directly accessing video memory is a very complex thing on modern GPUs, and essentially not possible without a metric crapload of supporting code to figure out where you need to write, what format to write it in, and so on. Writing may involve a lot of complex GPU rendering commands and not even allow directly writing to the video memory, or memory might only be accessible through special interfaces (not something you can mmap). Tiled displays and the like make this even more difficult.
Even if someone could provide some code for you, it would likely work on only a specific single chipset. It certainly wouldn't work while the rest of the graphics stack was running.
This isn't the 80s anymore. Or even the 90s. Writing directly to framebuffer memory is not the way to accomplish whatever it is you're trying to do. You're almost certainly better off rendering whatever it is you're doing into a regular block of memory and then using SDL/GL/xlib to blit it to your app's window/buffer.
The only ways I can think of to do this (write to the framebuffer) is to use the Linux framebuffer, or the new kms with gem (I think that allows you to write to the framebuffer.
As far as directly modifying video memory, that's not something most sane people want to attempt. The GPU is almost a computer unto itself these days, with it's own memory management and threading system.