How does increasing the amount of carbon in steel affect it's properties?

The more carbon the harder the steel, but too much carbon gives brittle cast iron instead of steel.