Ferromagnetic cobalt nanowires with high-crystalline quality are synthesized using a low-voltage electrodeposition method. High-resolution transmission electron microscopy (HRTEM) and X-ray diffraction (XRD) results show that the nanowires are uniform in size, and consist of predominantly hexagonal close-packed (hcp) structure with the magnetocrystalline easy axis (c-axis) perpendicular to the wire axis. Superconducting quantum interference device (SQUID) measurements illustrate the dominance of shape anisotropy, manifested by the weak temperature dependence of the enhanced coercive field along the wire axis. Furthermore, the magnetic structures of individual, segmented, or intersected nanowires are studied using magnetic force microscopy. This reveals a strong dipole at the two ends of the wire, together with a spatial magnetization modulation along the wire. Based on theoretical modeling, such intrinsic modulation is attributed to magnetization frustration due to the competition between the magnetocrystalline polarization along the easy axis and the shape anisotropy along the wire axis.