I want to parse a script with
c++ to gain an output address from it.
can anybody introduce a suitable library or a sample code which extract addresses from scripts ?
Have a look at libbtc (https://github.com/libbtc/libbtc).
There is a function
btc_script_classify() which will return what script type it is (P2PK, P2PKH, P2SH, P2WPKH, P2WSH) and it will return data elements (usually the RIPEMD160 of the pubkey).