Click here to Skip to main content
15,906,081 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: implicit cast between pointers Pin
Iosif Murariu16-Jun-10 3:30
Iosif Murariu16-Jun-10 3:30 
Ok here goes. We're migrating our software to run on more platforms. Initially we had something like:

class A : public B {};
void function(B* x) {};


Obviously

A* y;
function(y);


used to work. Now we have some wrapper classes, call them xA (over A) and xB (over B). Therefore:

class xA : protected A {};
class xB : protected B {};
void function(xB* x){}; 


Since xA is not derived from xB, calling the function as before no longer works.

xA* x;
// doesn't work:
function(x);
// works:
function((xB*)x);


The protected in the inheritence between the base and wrapper classes is necesarry. All functions in A and B are overwritten in xA and xB respectively but no new members are added. This is part of the specs.

Now can you answer the question?
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 
QuestionRe: Pointer and Reference Pin
T.RATHA KRISHNAN16-Jun-10 3:05
T.RATHA KRISHNAN16-Jun-10 3:05 

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.