So before I move on with my idea I'd like to find out if it is possible to write a bitcoin wallet, at least the private key generating part, in C.
Of course. There is no reason why this shouldn't be doable in C. I guess you are planning to use libaries instead of doing this from scratch.
You can use LIBBTC (
https://github.com/libbtc/libbtc). But make sure how generation is exactly handled and how entropy is gathered.
And if you want to store larger amounts on your selfwritten wallet, make sure to catch any exceptions and create a testing environment to make sure it works properly in every case.