Encoding schemes using C