Well, there is no new keyword in C. std::cout does not exist in C.
The code is not totally flawless, you forget to delete the arrays you allocated before exiting the program.
+ Just change std::cout to printf().
+ Just change new to malloc() and free().