Click here to Skip to main content
15,886,873 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: [Challenge/Puzzle] Implement reinterpret_cast Pin
Brandon-X1200010-Mar-13 11:32
Brandon-X1200010-Mar-13 11:32 
GeneralRe: [Challenge/Puzzle] Implement reinterpret_cast Pin
Richard MacCutchan10-Mar-13 23:17
mveRichard MacCutchan10-Mar-13 23:17 
AnswerRe: [Challenge/Puzzle] Implement reinterpret_cast Pin
Matthew Faithfull11-Mar-13 1:44
Matthew Faithfull11-Mar-13 1:44 
GeneralRe: [Challenge/Puzzle] Implement reinterpret_cast Pin
Stefan_Lang11-Mar-13 23:18
Stefan_Lang11-Mar-13 23:18 
GeneralRe: [Challenge/Puzzle] Implement reinterpret_cast Pin
Matthew Faithfull11-Mar-13 23:40
Matthew Faithfull11-Mar-13 23:40 
GeneralRe: [Challenge/Puzzle] Implement reinterpret_cast Pin
MicroVirus13-Mar-13 11:12
MicroVirus13-Mar-13 11:12 
GeneralRe: [Challenge/Puzzle] Implement reinterpret_cast Pin
Matthew Faithfull13-Mar-13 11:18
Matthew Faithfull13-Mar-13 11:18 
GeneralRe: [Challenge/Puzzle] Implement reinterpret_cast Pin
MicroVirus13-Mar-13 11:29
MicroVirus13-Mar-13 11:29 
It's true that in many implementations of C/C++ a pointer to one type is technically (in terms of generated code and storage needs) the same as a pointer to any other type.
But in terms of the language, int* is certainly not an int**. At the very least, the compiler will give you an error on the line int **ppi = &i, saying there is no conversion from int* to int**. But ok, that's the compiler, so maybe it's just being annoying? One nice way, I think, of realising these two (int* and int**) are two very different objects is the following:
C++
int* pi = ...;
int** ppi = ...;
*pi; *ppi; // These two are both valid C++ and we know what this means
**ppi; // This is also valid, but the following:
**pi; // Is not valid, and it is not clear what it's suppose to mean; *pi gives an integer value, so what is the dereference of an integer?

So I'd say that int* and int** can't be the same thing, because the one can do something the other can't Wink | ;)
GeneralRe: [Challenge/Puzzle] Implement reinterpret_cast Pin
Stefan_Lang11-Mar-13 3:29
Stefan_Lang11-Mar-13 3:29 
GeneralRe: [Challenge/Puzzle] Implement reinterpret_cast Pin
harold aptroot11-Mar-13 9:03
harold aptroot11-Mar-13 9:03 
GeneralRe: [Challenge/Puzzle] Implement reinterpret_cast Pin
Stefan_Lang11-Mar-13 22:30
Stefan_Lang11-Mar-13 22:30 
GeneralRe: [Challenge/Puzzle] Implement reinterpret_cast Pin
Stefan_Lang12-Mar-13 0:09
Stefan_Lang12-Mar-13 0:09 
GeneralRe: [Challenge/Puzzle] Implement reinterpret_cast Pin
MicroVirus13-Mar-13 11:19
MicroVirus13-Mar-13 11:19 
GeneralRe: [Challenge/Puzzle] Implement reinterpret_cast Pin
Stefan_Lang13-Mar-13 23:07
Stefan_Lang13-Mar-13 23:07 
Questiontinyxml Pin
venkatesh528678-Mar-13 16:43
venkatesh528678-Mar-13 16:43 
AnswerRe: tinyxml Pin
Richard MacCutchan8-Mar-13 21:48
mveRichard MacCutchan8-Mar-13 21:48 
AnswerRe: tinyxml Pin
Albert Holguin10-Mar-13 14:39
professionalAlbert Holguin10-Mar-13 14:39 
QuestionInsert is working but Select from this music site is not! Pin
Ericdick8-Mar-13 1:48
Ericdick8-Mar-13 1:48 
GeneralRe: Insert is working but Select from this music site is not! Pin
Jochen Arndt8-Mar-13 1:54
professionalJochen Arndt8-Mar-13 1:54 
QuestionHow can i put Install button in my mfc property sheet Pin
venkatesh528677-Mar-13 3:28
venkatesh528677-Mar-13 3:28 
AnswerRe: How can i put Install button in my mfc property sheet Pin
Richard MacCutchan7-Mar-13 3:34
mveRichard MacCutchan7-Mar-13 3:34 
QuestionRe: How can i put Install button in my mfc property sheet Pin
David Crow7-Mar-13 7:47
David Crow7-Mar-13 7:47 
QuestionJSON Parser Pin
john56326-Mar-13 23:20
john56326-Mar-13 23:20 
AnswerRe: JSON Parser Pin
CPallini7-Mar-13 0:17
mveCPallini7-Mar-13 0:17 
QuestionRe: JSON Parser Pin
David Crow7-Mar-13 3:00
David Crow7-Mar-13 3:00 

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.