By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,107 Members | 1,365 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,107 IT Pros & Developers. It's quick & easy.

cout<<complex_num gives seg fault w/ intel compiler

P: n/a
I have

#include<iostream>
#include<complex>
typedef std::complex<float> ComplexSingle;
int main(void)
{
ComplexSingle a(2,3);
std::cout<<a.real()<<std::endl;//this works
std::cout<<a.imag()<<std::endl;//this works
std::cout<<a;//this works w/ g++, not icc.
return 1;
}

I think this problem is compiler specific but if u guys can help,
please do. I have searched all over the net to no avail.
thanx

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

<bl**********@gmail.com> wrote in message
news:11********************@g49g2000cwa.googlegrou ps.com...
I have

#include<iostream>
#include<complex>
typedef std::complex<float> ComplexSingle;
int main(void)
{
ComplexSingle a(2,3);
std::cout<<a.real()<<std::endl;//this works
std::cout<<a.imag()<<std::endl;//this works
std::cout<<a;//this works w/ g++, not icc.
return 1;
}

I think this problem is compiler specific but if u guys can help,
please do. I have searched all over the net to no avail.
thanx


I compiled it with both g++ and MSVC 7.1 and it worked fine.

Regards,
Ben
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.