You can do it all in C, but unless you are good at it and know a bunch of libraries, the method I suggested will likely be a lot easier, since there are examples to build on.
If you have different constraints, like specific languages, etc. it's always a good thing to put it in the post where you ask for help.
/Thomas