The simplest way to use zlib is in C++ with
https://github.com/rudi-cilibrasi/zlibcomplete
The zlibcomplete library makes it easy because you don't need to do any raw pointer manipulation whatsoever. It is based on RAII (Resource Allocation is Initialization) which means that all the dynamic allocation and deallocation stuff happens automatically in the constructors.
It is better than the Boost zlib wrapper because it supports flush (necessary for interactive network protocols) and is simpler to use. The zlibcomplete library uses only regular std::string to send and receive data so no advanced knowledge is required.