South Africa's president visited a gravely ill Nelson Mandela in the hospital on Wednesday night, and canceled a visit planned for the next day to Mozambique, an indication of heightened concern over the deteriorating health of the man widely considered the father of the country.