Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #5934

basic_ostream question

From Ruben Safir <ruben@mrbrklyn.com>
Newsgroups comp.lang.c++
Subject basic_ostream question
Date 2011-06-01 01:45 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <is45j3$s8u$1@reader1.panix.com> (permalink)

Show all headers | View raw


can simeone explain why the last 3 lines don't behave like expected

#include <iomanip>


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;
}

Back to comp.lang.c++ | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

basic_ostream question Ruben Safir <ruben@mrbrklyn.com> - 2011-06-01 01:45 +0000
  Re: basic_ostream question red floyd <no.spam.here@its.invalid> - 2011-05-31 21:50 -0700
    Re: basic_ostream question ruben safir <ruben@mrbrklyn.com> - 2011-06-02 22:44 -0400
      Re: basic_ostream question Michael Doubez <michael.doubez@free.fr> - 2011-06-03 02:56 -0700

csiph-web