C sample codes