 In order for a string theory to be consistent, the worldsheet theory must be conformally invariant.The obstruction to conformal symmetry is known as the Weyl anomaly and is proportional to the central charge of the worldsheet theory.In order to preserve conformal symmetry the Weyl anomaly, and thus the central charge, must vanish.