Click here to Skip to main content
15,919,613 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
Questioncan we declare destructor of a class as private? (C++) Pin
Anonymous17-Sep-05 12:42
Anonymous17-Sep-05 12:42 
AnswerRe: can we declare destructor of a class as private? (C++) Pin
Johann Gerell17-Sep-05 13:10
Johann Gerell17-Sep-05 13:10 
GeneralRe: can we declare destructor of a class as private? (C++) Pin
BlitzPackage17-Sep-05 13:57
BlitzPackage17-Sep-05 13:57 
AnswerRe: can we declare destructor of a class as private? (C++) Pin
Alexander M.,18-Sep-05 3:42
Alexander M.,18-Sep-05 3:42 
QuestionC/C++ Question Pin
Rajesh_K_Sharma17-Sep-05 7:05
Rajesh_K_Sharma17-Sep-05 7:05 
AnswerRe: C/C++ Question Pin
John M. Drescher17-Sep-05 8:31
John M. Drescher17-Sep-05 8:31 
GeneralRe: C/C++ Question Pin
RichardS17-Sep-05 16:47
RichardS17-Sep-05 16:47 
QuestionQuestion About Pointers in C++ Pin
17-Sep-05 5:54
suss17-Sep-05 5:54 
First, I appreciate any help or insight you can provide. Also, if there is a book or place wherin I can read up on the information I seek, please feel free to let me know. I am teaching myself how to program in C++.

My question regards pointers.

Assume: SomeObject * objectPtr = 0;
Assume: OtherObject * smallObjectPtr = 0;
Assume that SomeObject has member: OtherObject * leftPtr;
Also, each OtherObject object has member: OtherObject *leftPtr;

Note: this is from a binary tree node insertion and deletion attempt.

Assume that objectPtr has been pointed to an object of type SomeObject (Tree class) and that smallObjectPtr (Tree node class) has been pointed to an object of type OtherObject in a binary tree. Also, assume that these nodes are nestled midway down the tree and all the nodes at the level have at lest one or two children.

What is the difference between the following two declations:

*objectPtr->leftPtr = *smallObject->leftPtr

and

objectPtr->leftPtr = smallObjectPtr->leftPtr

Afterwards, I assign the pointers I have used to null.

Will the two result in different assignments?

How can I tell which one to use? Essentially, I want to know how the inclusion of the “*” dereference operator changes what happens.

This problem occurred because during the binary tree deletion attempt, the proper assignments were made via pointers to the different nodes, but any attempt to print the contents of the tree afterwards results in less than half of the remaining tree being printed.

Finally, is there anything wrong with the following declaration and what does it mean (or vice versa regarding the "*" dereference):

objectPtr->leftPtr = *smallObject->leftPtr;

Thanks, I appreciate any help you all can provide. If there is any way I can be of help or assistance to you or the community, let me know.




-- modified at 20:02 Saturday 17th September, 2005
AnswerRe: Question About Pointers in C++ Pin
TheGreatAndPowerfulOz17-Sep-05 15:03
TheGreatAndPowerfulOz17-Sep-05 15:03 
GeneralRe: Question About Pointers in C++ Pin
BlitzPackage17-Sep-05 15:35
BlitzPackage17-Sep-05 15:35 
GeneralRe: Question About Pointers in C++ Pin
Achim Klein17-Sep-05 15:42
Achim Klein17-Sep-05 15:42 
GeneralRe: Question About Pointers in C++ Pin
BlitzPackage17-Sep-05 15:46
BlitzPackage17-Sep-05 15:46 
GeneralRe: Question About Pointers in C++ Pin
Achim Klein17-Sep-05 15:56
Achim Klein17-Sep-05 15:56 
GeneralRe: Question About Pointers in C++ Pin
RichardS17-Sep-05 17:31
RichardS17-Sep-05 17:31 
GeneralRe: Question About Pointers in C++ Pin
Achim Klein18-Sep-05 1:41
Achim Klein18-Sep-05 1:41 
AnswerRe: Question About Pointers in C++ Pin
Achim Klein17-Sep-05 15:33
Achim Klein17-Sep-05 15:33 
GeneralRe: Question About Pointers in C++ Pin
BlitzPackage17-Sep-05 15:39
BlitzPackage17-Sep-05 15:39 
GeneralRe: Question About Pointers in C++ Pin
Johann Gerell17-Sep-05 19:24
Johann Gerell17-Sep-05 19:24 
GeneralRe: Question About Pointers in C++ Pin
Achim Klein18-Sep-05 1:50
Achim Klein18-Sep-05 1:50 
AnswerRe: Question About Pointers in C++ Pin
Johann Gerell17-Sep-05 19:48
Johann Gerell17-Sep-05 19:48 
QuestionAfxGetThread returning NULL in Debug Mode and causing crash Pin
Anonymous16-Sep-05 17:46
Anonymous16-Sep-05 17:46 
QuestionPure virtual function calls in Constructor Pin
RichardS16-Sep-05 11:05
RichardS16-Sep-05 11:05 
AnswerRe: Pure virtual function calls in Constructor Pin
S. Senthil Kumar16-Sep-05 20:16
S. Senthil Kumar16-Sep-05 20:16 
GeneralRe: Pure virtual function calls in Constructor Pin
RichardS17-Sep-05 16:33
RichardS17-Sep-05 16:33 
AnswerRe: Pure virtual function calls in Constructor Pin
Nemanja Trifunovic17-Sep-05 4:35
Nemanja Trifunovic17-Sep-05 4:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.