It probably won't work. Sorry, using C++ is totally overkilled for that (it's basically calling two endpoints on horizon api), but I was learning C++ so I took the opportunity.
Here is a javascript version you can paste in your (modern and up to date) browser : https://gist.github.com/oelmekki/57a915e92f826c81980908dc3ff59361
You just need to replace the "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" at the top with your public address (public address! ? ).
If you can't read javascript, you probably should wait for someone to confirm this is not malicious code. As much as I know I'm not an asshole, it's a bad idea to paste random javascript from the web ?