Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!crackers!m2c!wpi!ajb From: ajb@wpi.WPI.EDU (Arthur J. Butler) Newsgroups: comp.lang.c++ Subject: is it possible to cast a pointer to a pointer ? Keywords: pointer casting Message-ID: <16046@wpi.WPI.EDU> Date: 27 Sep 90 02:29:31 GMT Organization: Worcester Polytechnic Institute, Worcester, MA Lines: 22 assume i have too classes called Foo and Bar. i can define a conversion operator which will cast a type Bar to type Foo or a type Foo*. can i define a conversion operator to cast a Bar* to a Foo* ??? my thoughts are that i cannot, since the conversion operator takes no arguments. anyone want to show me wrong ?? /* some sample code */ class Foo { ..... }; class Bar { private: Foo *foo_ptr; public: ..... // granted, here we are giving away access to private data!! operator Foo*() { return(foo_ptr); } operator Foo() { return(*foo_ptr); } };