🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #3641

static_cast

#3641
From: alice yang
Date: Tue, 12 Mar 1996 02:11
20 lines
1343 bytes
C++ Guru
 Would you help me to understand the importance of using "static-cast"?

In the book, it states, "this cast construct is a better alternative than its 
c counterpart only becasue it is easier to locate a c++ cast construct in a 
source file"

So, does that mean the following is exactly the same?

float fnumber;
int   inumber;

fnumber=(float)inumber;
fnumber=<static_cast>inumber; /same as the first one??/
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
Technical Details
Message-ID: <30F54E6D.B4@worldnet.att.net>
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back

Show Full Headers
Complete Article Headers
From: alice yang <aliceyang@worldnet.att.net>
Message-ID: <30F54E6D.B4@worldnet.att.net>
X-Original-Date: Thu, 11 Jan 1996 09:52:45 -0800
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back
Date: 12 Mar 96 02:11:44 GMT
Approved: fjh@cs.mu.oz.au
Newsgroups: comp.std.c++
Subject: static_cast
Organization: AT&T WorldNet Services
X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBFAgUBMUTdguEDnX0m9pzZAQECNQGAg8eaCxlWMPMqNYjVeKKkjXFHQflS8Guc
 ug07iYHd9CYt74YfnZKTQw/6nLEDL9ie
 =uR+/