Structure modulated charge transfer in carbon atomic wires