Message-ID: <3B905BB5.3D9A5B60@erols.com> Date: Fri, 31 Aug 2001 23:53:25 -0400 From: Chris Smith X-Mailer: Mozilla 4.72 [en]C-CCK-MCD DT (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: and std::right? References: <20010831220708 DOT 29894 DOT qmail AT web10004 DOT mail DOT yahoo DOT com> <1DXj7.190$tc5 DOT 58905722 AT news DOT netcarrier DOT net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Remember, different things are sometimes defined or implimented a littlebit differently depending on what compiler or OS you are using. That article you pointed out may have been written with a different comiler in mind. The following versions should work fine... /////////////// // // Program one // /////////////// #include int main() { std::cout.setf(std::ios::dec, std::ios::basefield); std::cout.setf(std::ios::right, std::ios::adjustfield); std::cout.width(10); std::cout << 42 << std::endl; } /////////////// // // Program two // /////////////// #include #include int main() { std::cout.setf(std::ios::hex, std::ios::right); std::cout< In message <20010831220708 DOT 29894 DOT qmail AT web10004 DOT mail DOT yahoo DOT com>, chris > smith (c_smith_1 AT yahoo DOT com) wrote: > > :Use ios::right, not std::right. > > I didn't think ios::right was the same thing (?). > > For example, neither of these two programs (from > http://www.cuj.com/experts/1902/austern.htm?topic=experts) will compile > for me. Shouldn't they work with DJGPP? > > /////////////// > // > // Program one > // > /////////////// > #include > int main() { > std::cout.setf(std::ios_base::hex, > std::ios_base::basefield); > std::cout.setf(std::ios::right, > std::ios_base::adjustfield); > std::cout.width(10); > std::cout << 42 << std::endl; > } > > /////////////// > // > // Program two > // > /////////////// > #include > #include > int main() { > std::cout << std::hex << std::right << std::setw(10); > std::cout << 42 << std::endl; > } > > -------------------------------------------------------------- > Brian Kennedy > brk AT eclipse DOT net