Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!apple!spies!zorch!tandem!wizard!larry From: larry@wizard.dsg.tandem.com (Larry Wear) Newsgroups: comp.lang.c++ Subject: Why doesn't a void* & parameter get modified in C++ 2.0? Keywords: ? Message-ID: <1208@wizard.dsg.tandem.com> Date: 12 Apr 90 22:56:04 GMT Distribution: usa Organization: Tandem Computers, Cupertino, CA Lines: 34 The following program works correctly using AT&T's cfront 1.2, however it does not work correctly using Sun's cfront 2.0. The NullIt method in the class go does not modify the pointer value of name. I would like to know why. Thanks. #include #include #define NULL 0 typedef void* ANY; class bigFun { public: void NullIt( ANY & pObject ) { pObject = NULL; } }; void main() { bigFun go; char * name = malloc(5); go.NullIt( (ANY)name ); if ( name == NULL ) cout << "Success\n"; else cout << "Failed\n"; } -- Larry Wear wizard!larry@Tandem.COM Tandem Computers