From 4043728850815280253
X-Google-Thread: f78e5,191c67e7ffa6c8e7
X-Google-NewGroupId: yes
X-Google-Attributes: gid7894ca11fe,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news4.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 11 Oct 2010 18:10:02 -0500
Return-Path: <cppmods@assassin.cs.rpi.edu>
X-Hash: SCt|7756f4c2ed7e1a3efbaced4008f802cd5423affa|f18d2219a37fc041fa06509f0e743160
X-Countries: United States
X-SMTP-From: accepted <cppmods@assassin.cs.rpi.edu> assassin.cs.rpi.edu [128.113.126.17] (assassin.cs.rpi.edu) {United States}
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=cs.rpi.edu; h=date
	:to:sender:message-id:from:subject:references:content-type; s=
	default; i=128.113.126.17@cs.rpi.edu; t=1286838401; x=
	1287443201; l=960; bh=eVKPpkuQrcDIe3xkdt6NLAOS6FA=; b=FEIOXXNDR6
	V3DMyviiFi4AkHa4nSiETr7hMAjfxU9ksQr1yYTMIxtAR33td3tmNqi1t4equsSx
	WNVaeWHwNE0Kz+ZG3XazEaowuFXZ0Zd3qF6pBniq7Grjfv3gUqNCAsnUqQquDb/B
	bHe7KDlgmz/7dAUGc7N/E8vWvq9JXV3kA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=cs.rpi.edu; h=date:to:sender
	:message-id:from:subject:references:content-type; q=dns; s=
	default; b=QFaNEr6wIqA3yjNUHt8l9tUqCqNXiCeAWpocosHZAr0RqUoIqFnx+
	0F1lvG/RghPWyAv3atoOjDHBc746FottJV2h02NwwEKeDCh/UYiHKxZQxvyJhY0R
	upZLHE4LYGONZSIIZagGvsZbPS1h26NyDUk/k99iazIAvrAlDcQHGM=
X-Spam-Report: Spam Report from cliffclavin.cs.rpi.edu (SA:3.2.5):
	-1.8 ALL_TRUSTED            Passed through trusted hosts only via SMTP
	3.4 HEADER_SPAM            Bulk email fingerprint (header-based) found
	-0.9 BAYES_00               BODY: Bayesian spam probability is 0 to 1% [score: 0.0000]
	0.2 SARE_HEAD_HDR_APPROV   Message headers used which identify spam
	0.0 AWL                    AWL: From: address is in the auto white-list
X-Spam-Info: 0.9, local;
	ALL_TRUSTED,AWL,BAYES_00,HEADER_SPAM,SARE_HEAD_HDR_APPROV
X-Spam-Scanned-By: cliffclavin.cs.rpi.edu using SpamAssassin 3.2.5
X-Virus-Scanned-By: cliffclavin.cs.rpi.edu
To: (Usenet)
Sender: std-c++-request@ruralroute.cs.rpi.edu
Approved: james.dennett@gmail.com 
Message-ID: <d15341eb-a6c3-41cf-aee9-915f335b24c9@a15g2000yqm.googlegroups.com>
Newsgroups: comp.std.c++
From: James Kanze <james.kanze@gmail.com>
Subject: Re: reinterpret_cast<char *>(&some_int) 
Organization: http://groups.google.com
References: <31551.76926.qm@web110410.mail.gq1.yahoo.com>
Content-Type: text/plain; charset=ISO-8859-1
X-Original-Date: Mon, 11 Oct 2010 13:39:51 -0700 (PDT)
X-Submission-Address: std-c++@netlab.cs.rpi.edu
X-Scanned-By: MIMEDefang 2.67 on 128.113.126.25
Date: Mon, 11 Oct 2010 18:06:41 CST
Lines: 31
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-5QYyfqZJHfzz1xwFYjILAFWUmduYCLe9KjW8J0EEvStS76vHY+x10bJVQPrceHfLEkEFQs/dEXB+19Y!s/3azZO+8DuDMOnl8Hns5TKtL8792I9iG0HsKBdhvPUn7BUxvMoq+JcOGrKFruBUQfa+z6xSiITH!vWSvt4Ec3NK23YoBclTZo6J8FAU=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 4003
Xref: g2news1.google.com comp.std.c++:3044

On Oct 11, 9:07 pm, Trigve Siver <trig...@yahoo.com> wrote:

> I've got the question regarding the reinterpret_cast. Is this defined
> by c++0x (I mean current working draft n3126)?:

> std::ifstrem input(...); // Opened as binary
> ....
> int vaue;
> input.read(reinterpret_cast<char *>(&value), sizeof(value)); // Whereinput
> "has"
> int

It is and it isn't.  About all you can say is that you're more
or less guaranted to pass the address of the int into
input.read.  Since this function expects the address of a char
buffer, and will write it as such, just about anything can
happen after that.

> And what about reinterpret_cast<char *>(&some_pod)?

The same.

--
James Kanze

--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]



