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

Managed C++/CLI

 
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 
Hi,

1) What is the difference between the following two declations:
a) *objectPtr->leftPtr = *smallObject->leftPtr
b) objectPtr->leftPtr = smallObjectPtr->leftPtr

In an expression like int* pVal = &Val; you always have 2 involved objects:
- the 'real' object (here: int Val (defined anywhere else))
- the pointer (here: int* pVal)

So, 1a) will copy the content of your 'real' objects as follows:
objectPtr->leftPtr->memberA = smallObject->leftPtr->memberA;
objectPtr->leftPtr->memberB = smallObject->leftPtr->memberB;
objectPtr->leftPtr->memberC = smallObject->leftPtr->memberC;
If OtherObject has a Copy-Constructor 1a) will call it.
And 1b) will copy the content of your pointers (the numerical adress values).

2) How can I tell which one to use?
Depends on what you want to do:
- if you want to copy the content of your object, use 1a)
- if you want to have two pointers pointing at the same object, use 1b)

3) Finally, is there anything wrong with the following declaration and what does it mean (or vice versa regarding the "*" dereference):
Your VC++ compiler should give you a C2440 error.
This line says: OtherObject* = OtherObject. It's like int* = int. Obviously this can't work.


Regards
Achim Klein


We can do no great things, only small things with great love. - Mother Theresa
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 
GeneralRe: Pure virtual function calls in Constructor Pin
RichardS17-Sep-05 16:31
RichardS17-Sep-05 16:31 
QuestionConvert ASCII to HEX Pin
RedDragon2k16-Sep-05 9:23
RedDragon2k16-Sep-05 9:23 
AnswerRe: Convert ASCII to HEX Pin
RichardS17-Sep-05 16:57
RichardS17-Sep-05 16:57 
GeneralRe: Convert ASCII to HEX Pin
Johann Gerell17-Sep-05 23:13
Johann Gerell17-Sep-05 23:13 
GeneralRe: Convert ASCII to HEX Pin
RichardS18-Sep-05 5:22
RichardS18-Sep-05 5:22 
GeneralRe: Convert ASCII to HEX Pin
Johann Gerell18-Sep-05 6:22
Johann Gerell18-Sep-05 6:22 
QuestionC++ PROJECT HELP!!!! Pin
da_comp_learner15-Sep-05 19:25
da_comp_learner15-Sep-05 19:25 
AnswerRe: C++ PROJECT HELP!!!! Pin
Saksida Bojan16-Sep-05 2:27
Saksida Bojan16-Sep-05 2:27 

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.