First version in "pure" C.
Second version using a class.