Your FFT code initializes a complex array because that is what the Fourier Transform produces. You should understand the complex exponential, and the nature of the transform as a change of basis (i.e. a projection onto a basis of sines & cosines).
It is a big topic that is well travelled, start here: http://stackoverflow.com/questions/10304532/why-does-fft-produce-complex-numbers-instead-of-real-numbershttps://stackoverflow.com/questions/10304532/why-does-fft-produce-complex-numbers-instead-of-real-numbers