PDA

View Full Version : how can i use cmplex numbers



shivendra46d
17th October 2013, 13:08
Hi.
i want to use complex numbers for calculation.
I am trying to include
#include<complex> of standard c++ file but cant use it. I tried to look for tutorials for it but there is none available. Please help.

stampede
17th October 2013, 13:23
what errors do you get ?

myta212
17th October 2013, 14:50
Hi,
Where are you search the tutorial ?

http://www.cplusplus.com/reference/complex/
http://www.cplusplus.com/reference/complex/real/
etc...

Best regards,

Toto

Radek
17th October 2013, 17:46
What's wrong with #include <complex> exactly?

(1) Is "complex" file on your include path?
(2) Is "complex.h" file on your include path?
(3) Does using "#include <complex> produce compile errors? Note that "complex" is a template nowadays. You need to declare "complex<double> somecomplex". If you need the "old way" when "complex" was a class then #include complex.h and use "double complex somecomplex;"

shivendra46d
21st October 2013, 06:11
when i try include the complex.h file it gives me error no such file.

Yes i did. And tried to implement it but when ever i include the complex.h file it giver error no such file

it gives me error that no such file. I will look weather it is in my include path or not

Added after 25 minutes:

Thanks, your suggestion solved my problem