In situ doping control and electrical transport investigation of single and arrayed CdS nanopillars.