cpp implementation of Multiply Strings