C version of 047