Sample of using pointers and malloc. Reads HTTP 1.1 headers from stdin and just retains the Set-Cookie keys.
Compile using
make
make test01 and make test02 run set a HTTP 1.1 headers though standard in.
This has been tested on MacOS X, CentOS 7.4 and Ubuntu 18.04