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

Managed C++/CLI

 
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 
The basic thing to remember about a pointer of type A* is that it either points at nothing (NULL) or to a memory address where a chunk of memory resides which size is an even multiple of sizeof(A).

Imagine a part of the memory space, where an A[4] array resides and a pointer A* pA which points at the first of these As:
A chunkA[4];
A* pA = A; // Equal to A* pA = &A[0];
And this looks like:
| | | | | | |A|A|A|A| | | | | | | |
|_|_|_|_|_|_|0|1|2|3|_|_|_|_|_|_|_|

             ^
             | 
             |------------- pA
Now we can say
A a0 = *pA++; // (a)
A a1 = *pA++; // (b)
A a2 = *pA++; // (c)
A a3 = *pA;   // (d)
Stepping pA once more would take it outside the A[4]. Since we don't know what is there, we don't want to dereference pA if it points there, e.g.:
A a3 = *pA++
A a4 = *pA;
have small chances of resulting in expected behavior...

The expressions (a) - (d) will all invoke the copy constructor of A, which in the default case will invoke the copy constructor for all its members that have a copy constructor and make a binary copy of pod mebers that lack copy constructors. Ad infinitum. Sort of.


--
The Blog: Bits and Pieces
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 
Questionwhat is the problem? Pin
mcnu15-Sep-05 16:20
mcnu15-Sep-05 16:20 
QuestionGraphic in linux Pin
Ta Xuan Hung15-Sep-05 15:19
Ta Xuan Hung15-Sep-05 15:19 
AnswerRe: Graphic in linux Pin
Christian Graus15-Sep-05 15:38
protectorChristian Graus15-Sep-05 15:38 
AnswerRe: Graphic in linux Pin
Christian Graus15-Sep-05 15:51
protectorChristian Graus15-Sep-05 15:51 

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.