You must Learn C/C++
to transform the code. C++ is an extension of C. It isnt so hard, when you know another languages.
The obvious difference is that you use a lot of curly braces. ;-)
Your problem is that you use some functions which arent so common in C. My tip is that you search in the internet for some replacement code. Check whethe you need really C or can use C++ and some class libraries.