|
-
April 16th, 1999, 07:17 PM
#1
Problems with Complex Math in C++
I'm new to C and C++ programming and I've chosen MS VC++ V6.0 for my
work. The question that I have is:
How do I declare complex variables, arrays and functions in C++ V6.0?
I understand that I need to include the appropriate header file in my source code. I do this using:
#include <complex>
Everything that I've tried has failed.
By the way, at this time I'm just trying to implement a simple console
program.
-
April 17th, 1999, 02:23 AM
#2
Re: Problems with Complex Math in C++
You need to make the complex into the namespace, for example:
#include <complex>
using namespace std;
//......
complex<double> d1(10, 5), d2(5, 10);
d1 += d2; // d1.real() = 15, d1.imag() = 15
//........
Hope this will help. Good luck.
Lynx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|