complex <double> as return type or parameter

M

mhs1pk

Hi,
I m a having problem while trying to make the return type of a method
in MFC appl in VC6 as complex<double>. If i declear a variable wth
std::complex<double> type, it is compled successfully. But when i use
it as a return type, it gives compilation errors. Please help me out...
 
R

Rolf Magnus

Hi,
I m a having problem while trying to make the return type of a method
in MFC appl in VC6 as complex<double>. If i declear a variable wth
std::complex<double> type, it is compled successfully. But when i use
it as a return type, it gives compilation errors.

Are we supposed to guess what the errors are, or how the code looks? You
know, crystal balls are expensive these days, and their quality is bad.
They need lots of repairs.
Please help me out...

You need to provide more information about your problem.
 
J

John Carson

Hi,
I m a having problem while trying to make the return type of a method
in MFC appl in VC6 as complex<double>. If i declear a variable wth
std::complex<double> type, it is compled successfully. But when i use
it as a return type, it gives compilation errors. Please help me
out...

What are the compilation errors. We are not psychics. The following compiles
fine for me with VC++6:

#include <complex>

std::complex<double> foo()
{
std::complex<double> c(1,1);
return c;
}


int main()
{
std::complex<double> cd = foo();
return 0;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top