cpp write