cross from iostream to stdio