MESSAGE
DATE | 2011-06-05 |
FROM | Ruben Safir
|
SUBJECT | Subject: [NYLXS - HANGOUT] (fwd) Re: basic_ostream question
|
-- forwarded message -- Path: reader1.panix.com!panix!news.linkpendium.com!news.linkpendium.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: red floyd Newsgroups: comp.lang.c++ Subject: Re: basic_ostream question Date: Tue, 31 May 2011 21:50:58 -0700 Organization: A noiseless patient Spider Lines: 31 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 1 Jun 2011 04:51:01 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="NpBbhNUiO09/nXkKwjSTuA"; logging-data="11556"; mail-complaints-to="abuse-at-eternal-september.org"; posting-account="U2FsdGVkX1/dBE0WFTvaOZUinCFiwQZfWPWKCmAewBA=" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: Cancel-Lock: sha1:CqyQYojuNw2dFLkqzh72Uck5Lmg= Xref: panix comp.lang.c++:1085772
On 5/31/2011 6:45 PM, Ruben Safir wrote: > can simeone explain why the last 3 lines don't behave like expected > > #include > > > int main(int argv, char ** argc){ > > char x = 'm'; > float a = 3.14, b = 9.3453, e = 3, f = 1/3; > f = (1.0 / 3); > short c = 6; > std::cerr.write( "x = ", 4); > std::cerr.put(x); > std::cerr.put( '\n'); > std::cerr<< "x = "<< x<< std::endl; > std::cout<< "a + b + c = "<< std::scientific<< a + b + c<< " hello World"<< std::endl; > std::cout<< "a + b + c = "<< std::fixed<< a + b + c<< std::endl; > std::cout<< "e * f = "<< e<< " * "<< f<< "="<< e * f<< std::endl; > ((std::cout.write("x= ", 3)).operator<<(x)).operator<<(std::endl); > ((std::cout.operator<<("x= ")).operator<<(x)).operator<<(std::endl); > std::cout<< "x = "<< x<< std::endl; > } >
Ignoring the missing #include , exactly how were you expecting it to behave, and what did you see instead?
Please see FAQ 5.8
-- end of forwarded message --
|
|