Click here to Skip to main content
16,007,277 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: does VB have STL? Pin
Michael P Butler17-Aug-02 3:51
Michael P Butler17-Aug-02 3:51 
Generalsimple browser Pin
slah16-Aug-02 23:43
slah16-Aug-02 23:43 
GeneralRe: simple browser Pin
bebe harhour17-Aug-02 0:32
bebe harhour17-Aug-02 0:32 
GeneralRe: simple browser Pin
Sijin17-Aug-02 1:14
Sijin17-Aug-02 1:14 
Generalusing complex template functions Pin
oRion16-Aug-02 22:49
oRion16-Aug-02 22:49 
GeneralRe: using complex template functions Pin
peterchen16-Aug-02 23:49
peterchen16-Aug-02 23:49 
GeneralRe: using complex template functions Pin
oRion17-Aug-02 2:43
oRion17-Aug-02 2:43 
GeneralRe: using complex template functions Pin
Sijin18-Aug-02 20:48
Sijin18-Aug-02 20:48 
From MSDN

// complex_conj.cpp
// compile with: /EHsc
#include <complex>
#include <iostream>

int main( )
{
   using namespace std;

   complex <double> c1 ( 4.0 , 3.0 );
   cout << "The complex number c1 = " << c1 << endl;

   double dr1 = real ( c1 );
   cout << "The real part of c1 is real ( c1 ) = "
        << dr1 << "." << endl;

   double di1 = imag ( c1 );
   cout << "The imaginary part of c1 is imag ( c1 ) = "
        << di1 << "." << endl;

   complex <double> c2 = conj ( c1 );
   cout << "The complex conjugate of c1 is c2 = conj ( c1 )= "
        << c2 << endl;

   double dr2 = real ( c2 );
   cout << "The real part of c2 is real ( c2 ) = "
        << dr2 << "." << endl;

   double di2 = imag ( c2 );
   cout << "The imaginary part of c2 is imag ( c2 ) = "
        << di2 << "." << endl;

   // The real part of the product of a complex number
   // and its conjugate is the norm of the number
   complex <double> c3 = c1 * c2;
   cout << "The norm of (c1 * conj (c1) ) is c1 * c2 = "
        << real( c3 ) << endl;
}
Output
The complex number c1 = (4,3)
The real part of c1 is real ( c1 ) = 4.
The imaginary part of c1 is imag ( c1 ) = 3.
The complex conjugate of c1 is c2 = conj ( c1 )= (4,-3)
The real part of c2 is real ( c2 ) = 4.
The imaginary part of c2 is imag ( c2 ) = -3.
The norm of (c1 * conj (c1) ) is c1 * c2 = 25


May the Source be with you
Sonork ID 100.9997 sijinjoseph

GeneralNetworking API Pin
helsten216-Aug-02 21:47
helsten216-Aug-02 21:47 
GeneralRe: Networking API Pin
Anonymous17-Aug-02 4:42
Anonymous17-Aug-02 4:42 
GeneralRe: Networking API Pin
helsten217-Aug-02 6:10
helsten217-Aug-02 6:10 
GeneralRe: Networking API Pin
Daniel Lohmann17-Aug-02 11:34
Daniel Lohmann17-Aug-02 11:34 
GeneralRe: Networking API Pin
helsten217-Aug-02 11:39
helsten217-Aug-02 11:39 
GeneralRe: Networking API Pin
dlhson17-Aug-02 9:04
dlhson17-Aug-02 9:04 
GeneralRe: Networking API Pin
helsten217-Aug-02 9:57
helsten217-Aug-02 9:57 
GeneralControlling iostream display behaviour. Pin
oRion16-Aug-02 20:45
oRion16-Aug-02 20:45 
GeneralRe: Controlling iostream display behaviour. Pin
Sijin17-Aug-02 1:21
Sijin17-Aug-02 1:21 
GeneralRe: Controlling iostream display behaviour. Pin
oRion17-Aug-02 2:37
oRion17-Aug-02 2:37 
GeneralRe: Controlling iostream display behaviour. Pin
Sijin18-Aug-02 20:51
Sijin18-Aug-02 20:51 
General.fon file format Pin
surbinsho16-Aug-02 18:59
surbinsho16-Aug-02 18:59 
GeneralRe: .fon file format Pin
Roger Allen19-Aug-02 5:04
Roger Allen19-Aug-02 5:04 
GeneralRe: Invalidate problem Pin
Daniel Ferguson16-Aug-02 21:14
Daniel Ferguson16-Aug-02 21:14 
GeneralRe: Invalidate problem Pin
Zayax16-Aug-02 23:07
Zayax16-Aug-02 23:07 
GeneralRe: Invalidate problem Pin
Anonymous17-Aug-02 4:12
Anonymous17-Aug-02 4:12 
GeneralRe: Invalidate problem Pin
dlhson17-Aug-02 9:09
dlhson17-Aug-02 9:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.