C. Formation of ketals/acetals. Thioketals/thioacetals are analogous; substitute R'SH for R'OH.
Note that acid (usually Bronsted, but also Lewis acid is possible) is critical to the mechanism. This does not proceed past the hemiacetal under neutral or basic conditions.