added buffer exchange example to c code