Does anyone have any idea how I can do this in C++?