home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!ukma!darwin.sura.net!convex!seas.smu.edu!ravi
- From: ravi@seas.smu.edu (Ravi Gupta)
- Subject: How to load complex.h?
- Message-ID: <1992Aug19.220824.5257@seas.smu.edu>
- Keywords: c++
- Sender: news@seas.smu.edu (USENET News System)
- Nntp-Posting-Host: zebra.seas.smu.edu
- Organization: School of Engineering and Applied Science
- Date: Wed, 19 Aug 1992 22:08:24 GMT
- Lines: 39
-
- I have the following program in C++, which
- gives the unknown system msgs, when compiled
- with g++(ver 2.2.2). Can any one tell me
- how to properly link complex.h?
- I would appreciate if you send me the mail
- instead of putting on the net.
- Thanks;
- Ravi
- Here is the code:
- ----------------------------------
- /* a program that manipulates complex numbers */
- #include <Complex.h>
- main() {
- Complex x,y,a,b;
- Complex w = Complex(3.0,4.0);
- Complex z(9.0,10.0);
- const Complex k(5.0,6.0);
- x = Complex(4.0,5.0);
- y=x+w;
- z= Complex(2.0,0.0)*z;
- z= z*k;
- cout<<"\nEnter complex numbers\n";
- cin >> a;
- cout << "\nx= " <<x;
- cout << "\ny= " <<y;
- cout << "\nz= " <<z;
- b=2*a;
- cout << "\nb= " <<b;
- cout << "\nmagnitude b= " <<abs(b);
- cout << "angle b= " <<arg(b);
- }
-
-
-
- --
- =================================(O)========================================
-
- Ravi Gupta INTERNET:ravi@csvax.seas.smu.edu
- Grad.Student YELLNET :(214)692-0433
-