Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Problem with cout, complex type on Xcode
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="mk ii" data-source="post: 1490169" data-attributes="member: 291703"><p>Hi,</p><p>The following segment:</p><p></p><p>[CODE]#include <iostream></p><p>#include <complex></p><p></p><p>int main (int argc, char * const argv[]) </p><p>{</p><p> std::complex<double> a(1.,1.);</p><p> std::cout << "a = "<< a << "\n";</p><p> return 0;</p><p>}[/CODE]</p><p></p><p>using Xcode 3.2 (the project setting is 'Command Line tool') on OSX 10.6.8 compiles fine and produces the following output:</p><p></p><p>a = (</p><p></p><p><img src="/mac_images/images/smilies/Confused.png" class="smilie" loading="lazy" alt=":Confused:" title="Confused :Confused:" data-shortname=":Confused:" />when of course it should produce:</p><p></p><p>a = (1.,1.)</p><p></p><p>Yes, I can display the real and imaginary parts using a.real(), a.imag() but the above should work.</p><p></p><p>Any ideas why Xcode / OSX has this weird behaviour? Has anyone else seen this, any suggestions?</p><p>Cheers,</p><p>m</p></blockquote><p></p>
[QUOTE="mk ii, post: 1490169, member: 291703"] Hi, The following segment: [CODE]#include <iostream> #include <complex> int main (int argc, char * const argv[]) { std::complex<double> a(1.,1.); std::cout << "a = "<< a << "\n"; return 0; }[/CODE] using Xcode 3.2 (the project setting is 'Command Line tool') on OSX 10.6.8 compiles fine and produces the following output: a = ( :Confused:when of course it should produce: a = (1.,1.) Yes, I can display the real and imaginary parts using a.real(), a.imag() but the above should work. Any ideas why Xcode / OSX has this weird behaviour? Has anyone else seen this, any suggestions? Cheers, m [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Problem with cout, complex type on Xcode
Top