---------------
Christof Meerwald@freec++.prog

home
> prog
>> freecpp
>>> new style casts

translate to German (by SYSTRAN)

New Style Casts

See 5.2.7 "Dynamic cast" [expr.dynamic.cast], 5.2.9 "Static cast" [expr.static.cast], 5.2.10 "Reinterpret cast" [expr.reinterpret.cast] and 5.2.11 "Const cast" [expr.const.cast] of the C++ standard.

Also see New cast syntax and semantics @ corfield.org.

> new_style_casts.cpp:

struct A
{
  virtual void f();
};

struct B
  : public A
{ };

A *a = 0;
B *b = dynamic_cast<B *>(a);

const char *c = 0;
char *d = const_cast<char *>(c);
char *e = reinterpret_cast<char *>(a);
A *f = static_cast<A *>(b);


int main()
{
  return 0;
}
---------------

This Web page is licensed under the Creative Commons Attribution - NonCommercial - Share Alike License. Any use is subject to the Privacy Policy.

Revision: 1.4, cmeerw.org/prog/freecpp/new_style_casts.html
Last modified: Mon Sep 03 18:20:50 2018
Christof Meerwald <cmeerw@cmeerw.org>
XMPP: cmeerw@cmeerw.org