If I comment out the second for loop, I don't get an error. I am trying to print the magnitude of my FFT result to the screen so that I can double check with Matlab to be sure it is working correctly. I suspect the problem has to do with variable type, but as far as I can tell this code should be correct. I have also tried %4f in place of the %4e with no luck. Any help would be much appreciated. Thanks.