🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #961

A question about casting operators

#961
From: Maya
Date: Sun, 23 Mar 2003 23:49
22 lines
2525 bytes
I have the following statement in my program
// from some where in the app
double val = some_number;
std::fstream f;
// the problem code
f.write( reinterpret_cast<char*>(val), sizeof(val) );

From this code I get an error message saying:
Invalid reinterpret_cast from type 'double' to type 'char*'

Can anyone help?


Thanks folks!!
-- 
====================== E-Communications Canada =====================
Jorge Escalante - Software Development Coordinator.
E-Mail Policy http://www.vif.com/users/escalante/Email_Policy.html

* You cannot exercise your power to a point of humiliation of others.
* What does an elephant do when he gets a broken toe?
          -He calls a toetruck
Technical Details
Message-ID: <pan.2003.03.23.23.49.07.796453@canada.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!newsfeed.mathworks.com!cyclone.swbell.net!newsfeed1.easynews.com!easynews.com!easynews!border3.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!nntp.vif.com!news.vif.com.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,51a98ffd65e99048,start
X-Google-Attributes: gid11318c,public
X-Google-Thread: fa69e,51a98ffd65e99048,start
X-Google-Attributes: gidfa69e,public
X-Google-Thread: 114592,51a98ffd65e99048,start
X-Google-Attributes: gid114592,public
X-Google-ArrivalTime: 2003-03-23 15:45:01 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!newsfeed.mathworks.com!cyclone.swbell.net!newsfeed1.easynews.com!easynews.com!easynews!border3.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!nntp.vif.com!news.vif.com.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 23 Mar 2003 17:44:54 -0600
From: "Maya" <escalante@canada.com>
Organization: NOME
Subject: A question about casting operators
Date: Sun, 23 Mar 2003 18:49:18 -0500
User-Agent: Pan/0.13.4 (She had eyes like strange sins. (Debian GNU/Linux))
Message-ID: <pan.2003.03.23.23.49.07.796453@canada.com>
Newsgroups: gnu.gcc.help,borland.public.cpp.borlandcpp,alt.comp.lang.learn.c-c++
Followup-To: gnu.gcc.help
Reply-To: escalante@canada.com
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Cache-Post-Path: www.vif.com!unknown@ip216-239-79-35.vif.net
X-Cache: nntpcache 2.4.0b4 (see http://www.nntpcache.org/)
Lines: 23
NNTP-Posting-Host: 216.239.64.141
X-Trace: sv3-rhkmJUhf9xiWzgrTyVF/IujLy5kponZVzuBhClHWjoXUf9LJcd3wYYYySLYY3BfU+8MwfU42U3tgU7F!6/eHsJBGE8SCoe/MN+WYVVjes0rgJCTFSpFzz7aHeS0Xr+3nvttKHGNhdhdKEzeTFivc+BCm1Ioq!pIFh
X-Complaints-To: abuse@vif.com
X-DMCA-Complaints-To: abuse@vif.com
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.1