The electronic and magnetic properties of ZnS nanowires (NWs) doped with C atom are studied in terms of the first-principle calculation. The result shows that C atom preferring to the surface position. All of the doped NWs show semiconductor character. The magnetic moments are mainly contributed by the C-2p orbital. Due to the hybridization interaction,a small magnetic moment is also induced in nearest neighboring Zn and S atoms. The magnetic moments of the C, Zn, and S atoms in the super cell have the same direction, indicating ferromagnetic coupling between them. The large energy difference (121 meV) between the ferromagnetic and antierromagnetic state implies room-temperature ferromagnetism for C-doped ZnS NWs, which has great potential in spintronic devices.