MESSAGE
DATE | 2011-06-05 |
FROM | Ruben Safir
|
SUBJECT | Subject: [NYLXS - HANGOUT] (fwd) basic_ostream question
|
-- forwarded message -- Path: reader1.panix.com!panix!not-for-mail From: Ruben Safir Newsgroups: comp.lang.c++ Subject: basic_ostream question Date: Wed, 1 Jun 2011 01:45:07 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 23 Message-ID: NNTP-Posting-Host: www2.mrbrklyn.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: reader1.panix.com 1306892707 28958 96.57.23.82 (1 Jun 2011 01:45:07 GMT) X-Complaints-To: abuse-at-panix.com NNTP-Posting-Date: Wed, 1 Jun 2011 01:45:07 +0000 (UTC) X-Blackjet: Blackjet is a Yankee Fan X-DRMisTHEFT: Use GNU Linux today X-From: A Dark Cloud X-LOCATION: Brooklyn NY - Forget abou' it! X-NYLXS: Really - yah think computers are supposed to be broken? User-Agent: Pan/0.133 (House of Butterflies) Xref: panix comp.lang.c++:1085769
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; }
-- end of forwarded message --
|
|