Add example of agent in C++
Add C version of sample agent and add extra flushes (via std::endl) in C++ version