MESSAGE
DATE | 2011-06-05 |
FROM | Ruben Safir
|
SUBJECT | Subject: [NYLXS - HANGOUT] (fwd) Re: basic_ostream question
|
From owner-hangout-outgoing-at-mrbrklyn.com Sun Jun 5 00:28:07 2011 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix) id 1310F100BED; Sun, 5 Jun 2011 00:28:06 -0400 (EDT) Delivered-To: hangout-outgoing-at-www2.mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix, from userid 28) id 725AA100BE0; Sun, 5 Jun 2011 00:28:05 -0400 (EDT) Delivered-To: hangout-at-nylxs.com Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by www2.mrbrklyn.com (Postfix) with ESMTP id F0419100BE7 for ; Sun, 5 Jun 2011 00:28:01 -0400 (EDT) Received: from panix2.panix.com (panix2.panix.com [166.84.1.2]) by mailbackend.panix.com (Postfix) with ESMTP id 32E4B32F46 for ; Sun, 5 Jun 2011 00:28:15 -0400 (EDT) Received: by panix2.panix.com (Postfix, from userid 20529) id 2472733C5F; Sun, 5 Jun 2011 00:28:15 -0400 (EDT) From: Ruben Safir To: hangout-at-nylxs.com Subject: [NYLXS - HANGOUT] (fwd) Re: basic_ostream question User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (NetBSD/5.1 (i386)) Message-Id: <20110605042815.2472733C5F-at-panix2.panix.com> Date: Sun, 5 Jun 2011 00:28:15 -0400 (EDT) Sender: owner-hangout-at-mrbrklyn.com Precedence: bulk Reply-To: hangout-at-mrbrklyn.com
-- forwarded message -- Path: reader1.panix.com!panix!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!16g2000yqy.googlegroups.com!not-for-mail From: Michael Doubez Newsgroups: comp.lang.c++ Subject: Re: basic_ostream question Date: Fri, 3 Jun 2011 02:56:45 -0700 (PDT) Organization: http://groups.google.com Lines: 26 Message-ID: References: NNTP-Posting-Host: 62.160.54.163 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1307095005 23811 127.0.0.1 (3 Jun 2011 09:56:45 GMT) X-Complaints-To: groups-abuse-at-google.com NNTP-Posting-Date: Fri, 3 Jun 2011 09:56:45 +0000 (UTC) Complaints-To: groups-abuse-at-google.com Injection-Info: 16g2000yqy.googlegroups.com; posting-host=62.160.54.163; posting-account=4_dwSAoAAAD_OEYz89wEMQOvnJlm6isC User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESRCNK X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1,gzip(gfe) Xref: panix comp.lang.c++:1085962
On 3 juin, 04:44, ruben safir wrote: > On 06/01/2011 12:50 AM, red floyd wrote: > > > ((std::cout.operator<<("x= ")).operator<<(x)).operator<<(std::endl); > > well for one thing, this one I didn't expect to get hex code.
Because, the only ioperator available is: basic_ostream& operator<<(const void* p);
Which writes the pointer value (like %#p in printf).
The string version is the free function:
template basic_ostream& operator<<(basic_ostream& out, const char* s); // ... other templates cf. 27.6.2.5.4 of the standard
Which computes the length and inserts the string into the stream. AFAIK there are no corresponding function in the std::ostream interface (for formated output).
-- Michael -- end of forwarded message --
|
|