With standard and resonant x-ray magnetic diffraction we investigate the magnetic properties of Pt atoms in a Co/Pt͑111͒ system. It is shown, that, depending on the thickness of the Co films, the magnetic anisotropy as monitored by the Pt magnetism changes from perpendicular to parallel, mimicking the behavior of the Co overlayer. Adsorption of carbon monoxide on very thin films has been found to change the easy magnetization axis. Moreover, the critical film thickness for the flipping of the easy direction of magnetization depends markedly on the growth temperature even in the vicinities of 300 K, where bulk alloying does not occur. A brief annealing to ϳ375 K of a parallel Co film suffices to reverse its easy direction to perpendicular. By analyzing the magnetic crystal truncation rods of the Pt surface, it is concluded that the change of anisotropy is due to site exchange between interfacial Co and Pt atoms. The site exchange which affects up to 4% of the interface atoms has been related to previous scanning tunneling microscopy findings on the same system. Comparison of magneto-optical and x-ray magnetic diffraction measurements on the same film show that the responses to the externally applied field are not identical. A possible explanation is suggested.