Oops, I forgot my standard disclaimer:

This code has not been tested nor proved correct*. I have not tried to run it, I have not even tried to compile it. In fact, I made it up on the spur of the moment in the Quick Reply box.

It's probably full of bugs, like missing header files. I take no responsibility for bugs with it, e.g. your computer running vvveeeeeeerrrryyyy slowly after executing it.
* Donald E. Knuth once said: "Beware of bugs in the above code; I have only proved it correct, not tried it.''