home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12595 < prev    next >
Encoding:
Text File  |  1992-08-19  |  1.3 KB  |  52 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!ukma!darwin.sura.net!convex!seas.smu.edu!ravi
  3. From: ravi@seas.smu.edu (Ravi Gupta)
  4. Subject: How to load complex.h?
  5. Message-ID: <1992Aug19.220824.5257@seas.smu.edu>
  6. Keywords: c++
  7. Sender: news@seas.smu.edu (USENET News System)
  8. Nntp-Posting-Host: zebra.seas.smu.edu
  9. Organization: School of Engineering and Applied Science
  10. Date: Wed, 19 Aug 1992 22:08:24 GMT
  11. Lines: 39
  12.  
  13. I have the following program in C++, which
  14. gives the unknown system msgs, when compiled
  15. with g++(ver 2.2.2). Can any one tell me
  16. how to properly link complex.h?
  17. I would appreciate if you send me the mail
  18. instead of putting on the net.
  19. Thanks;
  20. Ravi
  21. Here is the code:
  22. ----------------------------------
  23. /* a program that manipulates complex numbers */
  24. #include <Complex.h>
  25. main() {
  26.   Complex x,y,a,b;
  27.   Complex w = Complex(3.0,4.0);
  28.   Complex z(9.0,10.0);
  29.   const Complex k(5.0,6.0);
  30.   x = Complex(4.0,5.0);
  31.   y=x+w;
  32.   z= Complex(2.0,0.0)*z;
  33.   z= z*k;
  34.   cout<<"\nEnter complex numbers\n";
  35.   cin >> a;
  36.   cout << "\nx= " <<x;
  37.   cout << "\ny= " <<y;
  38.   cout << "\nz= " <<z;
  39.   b=2*a;
  40.   cout << "\nb= " <<b;
  41.   cout << "\nmagnitude b= " <<abs(b);
  42.   cout << "angle b= " <<arg(b);
  43. }
  44.  
  45.  
  46.  
  47. -- 
  48. =================================(O)========================================
  49.  
  50. Ravi Gupta                INTERNET:ravi@csvax.seas.smu.edu
  51. Grad.Student                YELLNET :(214)692-0433
  52.