G
Guest
I'm getting error C2062: type 'float' unexpected and error C2065: 'complex' : undeclared identifier when I try to compile this
#include "stdafx.h
#include <iostream> //Consol I/
#include <time.h> //So I can measure how long it take
#include <complex> //Complex math suppor
void fourn(complex <float> data[], int nn[], int ndim, int isign
...
If I simply declare a variable of type complex <float> and assign values to it, no errors
int main(
using namespace std
..
float Re, Im
..
complex <float> fData[1024]
..
for(i = 0; i < 1024; i++
Re = (float)rand()
Im = (float)rand()
fData.real(Re); //This gives odd results. Works ok with constant
fData.imag(Im)
..
..
cout << "Re is " << Re << " Im is " << Im << endl
cout << "fData[13] is " << fData[13] << endl
cout << "fData[13].real is " << fData[13].real() << ". fData[13].imag is " << fData[13].imag() << endl
..
This is beyond me. If I can declare and use the template variable, why can't I pass it as a function parameter
Cheers
Peter.
#include "stdafx.h
#include <iostream> //Consol I/
#include <time.h> //So I can measure how long it take
#include <complex> //Complex math suppor
void fourn(complex <float> data[], int nn[], int ndim, int isign
...
If I simply declare a variable of type complex <float> and assign values to it, no errors
int main(
using namespace std
..
float Re, Im
..
complex <float> fData[1024]
..
for(i = 0; i < 1024; i++
Re = (float)rand()
Im = (float)rand()
fData.real(Re); //This gives odd results. Works ok with constant
fData.imag(Im)
..
..
cout << "Re is " << Re << " Im is " << Im << endl
cout << "fData[13] is " << fData[13] << endl
cout << "fData[13].real is " << fData[13].real() << ". fData[13].imag is " << fData[13].imag() << endl
..
This is beyond me. If I can declare and use the template variable, why can't I pass it as a function parameter
Cheers
Peter.