🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.help
Article #476

compare types

#476
From: Tilo Levante
Date: Thu, 14 Feb 1991 08:11
28 lines
1366 bytes
assume the following classes:

class base;
class d1: public base;
class d2: public base;

base *v1;
d1 *v2;
v1 = new d1;

Is there a way to decide during runtime, wether
v1 points to a variable of type d1 or of type d2.

Or is there a way to decide wether 
  v2 = (d1*) v1;
is valid.

Thanks for any help.

Tilo 

*******************************************************************************
* Tilo Levante                            Domain: tilo@nmr.lpc.ethz.ch        *
* Institut fuer physikalische Chemie      UUCP:   ...!mcsun!chx400!ethz!tilo  *
* Eidgenoessische Technische Hochschule                                       *   
* ETH-Zentrum                             Phone:  +41/1/256-4372              *
* CH-8092 Zuerich                         Fax:    +41/1/252-3402              *
*******************************************************************************
Technical Details
Message-ID: <9102140811.AA16812@purcell.ethz.ch>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!tut.cis.ohio-state.edu!unreplyable!garbage

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!tut.cis.ohio-state.edu!unreplyable!garbage
From: tilo@nmr.lpc.ethz.ch (Tilo Levante)
Newsgroups: gnu.g++.help,comp.lang.c++
Subject: compare types
Message-ID: <9102140811.AA16812@purcell.ethz.ch>
Date: 14 Feb 91 08:11:46 GMT
Sender: daemon@tut.cis.ohio-state.edu
Followup-To: gnu.g++.help
Organization: Gatewayed from the GNU Project mailing list help-g++@prep.ai.mit.edu
Lines: 28