  Context. Carbon, oxygen and nitrogen (CNO) are key elements in stellar
formation and evolution, and their abundances should also have a significant
impact on planetary formation and evolution.
  Aims. We present a detailed spectroscopic analysis of 1110 solar-type stars,
143 of which are known to have planetary companions. We have determined the
carbon abundances of these stars and investigate a possible connection between
C and the presence of planetary companions. Methods. We used the HARPS
spectrograph to obtain high-resolution optical spectra of our targets. Spectral
synthesis of the CH band at 4300\AA was performed with the spectral synthesis
codes MOOG and FITTING.
  Results. We have studied carbon in several reliable spectral windows and have
obtained abundances and distributions that show that planet host stars are
carbon rich when compared to single stars, a signature caused by the known
metal-rich nature of stars with planets. We find no different behaviour when
separating the stars by the mass of the planetary companion.
  Conclusions. We conclude that reliable carbon abundances can be derived for
solar-type stars from the CH band at 4300\AA. We confirm two different slope
trends for [C/Fe] with [Fe/H] because the behaviour is opposite for stars above
and below solar values. We observe a flat distribution of the [C/Fe] ratio for
all planetary masses, a finding that apparently excludes any clear connection
between the [C/Fe] abundance ratio and planetary mass.
