Click here to Skip to main content
16,008,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: New In c and c++. Downloading data from a server Pin
ThatsAlok17-Jun-10 0:00
ThatsAlok17-Jun-10 0:00 
GeneralRe: New In c and c++. Downloading data from a server Pin
Eli Nurman17-Jun-10 1:37
Eli Nurman17-Jun-10 1:37 
Questionimplicit cast between pointers Pin
Iosif Murariu16-Jun-10 3:01
Iosif Murariu16-Jun-10 3:01 
AnswerRe: implicit cast between pointers PinPopular
Cedric Moonen16-Jun-10 3:06
Cedric Moonen16-Jun-10 3:06 
GeneralRe: implicit cast between pointers Pin
Iosif Murariu16-Jun-10 3:11
Iosif Murariu16-Jun-10 3:11 
GeneralRe: implicit cast between pointers Pin
Iosif Murariu16-Jun-10 3:13
Iosif Murariu16-Jun-10 3:13 
GeneralRe: implicit cast between pointers Pin
CPallini16-Jun-10 3:19
mveCPallini16-Jun-10 3:19 
GeneralRe: implicit cast between pointers Pin
Cedric Moonen16-Jun-10 3:20
Cedric Moonen16-Jun-10 3:20 
Arkh wrote:
but we're sure the memory layout of the classes permit this forced cast and that it actually works


Honnestly, that's a receipt for disaster: if later you have a programmer who wants to document the class and innocently swap two variables of your class, you are doomed. This is an extremly bad practice, and that's one of the reason why type safety is so strong in C++.
Anyway, you still didn't answer the question: WHY do you want something like that ? It doesn't make any sense that your function accept a pointer to A and you pass a pointer to B making believe the function that it is a pointer to A D'Oh! | :doh:
Cédric Moonen
Software developer

Charting control [v3.0]
OpenGL game tutorial in C++

GeneralRe: implicit cast between pointers Pin
Iosif Murariu16-Jun-10 3:30
Iosif Murariu16-Jun-10 3:30 
GeneralRe: implicit cast between pointers Pin
Cedric Moonen16-Jun-10 3:39
Cedric Moonen16-Jun-10 3:39 
GeneralRe: implicit cast between pointers Pin
Iosif Murariu16-Jun-10 3:42
Iosif Murariu16-Jun-10 3:42 
GeneralRe: implicit cast between pointers Pin
Cedric Moonen16-Jun-10 3:50
Cedric Moonen16-Jun-10 3:50 
GeneralRe: implicit cast between pointers Pin
Iosif Murariu16-Jun-10 3:58
Iosif Murariu16-Jun-10 3:58 
AnswerRe: implicit cast between pointers Pin
CPallini16-Jun-10 3:15
mveCPallini16-Jun-10 3:15 
AnswerRe: implicit cast between pointers Pin
Nemanja Trifunovic16-Jun-10 4:12
Nemanja Trifunovic16-Jun-10 4:12 
GeneralRe: implicit cast between pointers Pin
Iosif Murariu16-Jun-10 4:19
Iosif Murariu16-Jun-10 4:19 
GeneralRe: implicit cast between pointers Pin
Iosif Murariu16-Jun-10 4:23
Iosif Murariu16-Jun-10 4:23 
AnswerRe: implicit cast between pointers Pin
Iosif Murariu16-Jun-10 4:46
Iosif Murariu16-Jun-10 4:46 
GeneralRe: implicit cast between pointers Pin
CPallini16-Jun-10 6:11
mveCPallini16-Jun-10 6:11 
GeneralRe: implicit cast between pointers Pin
Iosif Murariu16-Jun-10 20:25
Iosif Murariu16-Jun-10 20:25 
GeneralRe: implicit cast between pointers Pin
Aescleal16-Jun-10 7:45
Aescleal16-Jun-10 7:45 
GeneralRe: implicit cast between pointers Pin
Iosif Murariu16-Jun-10 20:27
Iosif Murariu16-Jun-10 20:27 
GeneralRe: implicit cast between pointers [modified] Pin
Aescleal16-Jun-10 22:37
Aescleal16-Jun-10 22:37 
QuestionPointer and Reference Pin
T.RATHA KRISHNAN16-Jun-10 2:51
T.RATHA KRISHNAN16-Jun-10 2:51 
AnswerRe: Pointer and Reference Pin
Cedric Moonen16-Jun-10 2:54
Cedric Moonen16-Jun-10 2:54 

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.