C complex number usage

Bruce Labitt bruce.labitt at verizon.net
Sun Jan 6 16:47:23 EST 2008


Nope, I'm using Dev-C++ which is based on the MinGW compiler.  (gcc)

I'm just a bit frustrated that I can't even form a single complex number 
and print it out. :(

I've got a simpler scrap of code that doesn't work either. ;)
compiled with c++ compiler...

#include <cstdlib>
#include <iostream>
#include <complex>
using namespace std;

int main(int argc, char *argv[])
{
    double a, b;
    complex<double> c;
   
    a = 1.0;    // a is the real part
    b = 1.0;    // b is the imaginary part
    c = (a,b);  // form the complex number
    cout << c;
     
    system("PAUSE");
    return EXIT_SUCCESS;
}
The console *should* return with (1,1), but returns with (1,0). :(  Any 
ideas?

Ben Scott wrote:
> On Jan 6, 2008 2:05 PM, Michael ODonnell <michael.odonnell at comcast.net> wrote:
>   
>> What's the compiler version?
>>     
>
>   I can tell from the directory path in his original post that it's
> almost certainly some flavor of Microsoft Visual C++.
>
>   FWIW, Microsoft has some (limited) docs online:
>
> http://msdn2.microsoft.com/en-us/library/0352zzhd.aspx
>
> On Jan 6, 2008 2:14 PM, Michael ODonnell <michael.odonnell at comcast.net> wrote:
>   
>> Also, if you post your code here ...
>>     
>
>   Ummm... didn't he already do that?  :)
>
> http://article.gmane.org/gmane.org.user-groups.linux.gnhlug/12690
>
> -- Ben
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
>
>   



More information about the gnhlug-discuss mailing list