From a high level point of view, to place a buy-sell will require your program to interface with the Stock Exchange system isn't it ? Do they expose any API for external party? Do you need to sign an agreement with them in order to use their API ? Or they only provide a read-only API for you to get data? Is it payable?
So there are a lot of questions that need to be answered before you even attempt to write your own stock trading program in C++ isn't it ?