Click here to Skip to main content
15,895,370 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: pointer casting Pin
CPallini8-Apr-09 23:55
mveCPallini8-Apr-09 23:55 
AnswerRe: pointer casting Pin
Jorge9-Apr-09 0:07
Jorge9-Apr-09 0:07 
GeneralRe: pointer casting Pin
CPallini9-Apr-09 0:45
mveCPallini9-Apr-09 0:45 
GeneralRe: pointer casting Pin
Rajesh R Subramanian9-Apr-09 1:19
professionalRajesh R Subramanian9-Apr-09 1:19 
GeneralRe: pointer casting Pin
CPallini9-Apr-09 1:55
mveCPallini9-Apr-09 1:55 
GeneralRe: pointer casting Pin
Rajesh R Subramanian9-Apr-09 2:09
professionalRajesh R Subramanian9-Apr-09 2:09 
GeneralRe: pointer casting Pin
Jorge9-Apr-09 1:37
Jorge9-Apr-09 1:37 
AnswerRe: pointer casting Pin
Rajesh R Subramanian9-Apr-09 0:38
professionalRajesh R Subramanian9-Apr-09 0:38 
What do you mean by "conversion doesn't work"? There's actually no conversion that I can see. If you were wanting to convert the individual int elements of your int array to double, you should do that 'manually'. If you were just intending to change the pointer type, then there shouldn't be any difficulty:

int nArray[] = {1, 2, 3, 4};
double* pDouble = reinterpret_cast<double*>(nArray);
CString szStr;
szStr.Format(_T("%d %d"), *pDouble, *(pDouble+1)); //%d because you know it's an integer array
AfxMessageBox(szStr);

Of course, I assume that you know what reinterpret_cast does.


It is a crappy thing, but it's life -^ Carlo Pallini

GeneralRe: pointer casting Pin
Jorge9-Apr-09 1:08
Jorge9-Apr-09 1:08 
GeneralRe: pointer casting Pin
Rajesh R Subramanian9-Apr-09 1:13
professionalRajesh R Subramanian9-Apr-09 1:13 
GeneralRe: pointer casting Pin
Jorge9-Apr-09 1:40
Jorge9-Apr-09 1:40 
AnswerRe: pointer casting Pin
Divyang Mithaiwala9-Apr-09 1:01
Divyang Mithaiwala9-Apr-09 1:01 
GeneralRe: pointer casting Pin
Jorge9-Apr-09 1:19
Jorge9-Apr-09 1:19 
QuestionHeader file Pin
p_19608-Apr-09 21:25
p_19608-Apr-09 21:25 
AnswerRe: Header file Pin
«_Superman_»8-Apr-09 21:29
professional«_Superman_»8-Apr-09 21:29 
AnswerRe: Header file Pin
CPallini8-Apr-09 21:31
mveCPallini8-Apr-09 21:31 
AnswerRe: Header file Pin
ThatsAlok8-Apr-09 22:38
ThatsAlok8-Apr-09 22:38 
GeneralRe: Header file Pin
CPallini8-Apr-09 22:42
mveCPallini8-Apr-09 22:42 
AnswerRe: Header file Pin
Hamid_RT8-Apr-09 23:52
Hamid_RT8-Apr-09 23:52 
QuestionShellExecuteEx not working fine in case of Visual Studio 2008. Pin
Le@rner8-Apr-09 21:03
Le@rner8-Apr-09 21:03 
AnswerRe: ShellExecuteEx not working fine in case of Visual Studio 2008. Pin
Rajesh R Subramanian8-Apr-09 21:37
professionalRajesh R Subramanian8-Apr-09 21:37 
JokeRe: ShellExecuteEx not working fine in case of Visual Studio 2008. Pin
CPallini8-Apr-09 22:01
mveCPallini8-Apr-09 22:01 
JokeRe: ShellExecuteEx not working fine in case of Visual Studio 2008. Pin
Rajesh R Subramanian8-Apr-09 22:20
professionalRajesh R Subramanian8-Apr-09 22:20 
AnswerRe: ShellExecuteEx not working fine in case of Visual Studio 2008. Pin
Hamid_RT8-Apr-09 23:56
Hamid_RT8-Apr-09 23:56 
QuestionBasic Segmentation fault help needed Pin
Brandon Ramirez8-Apr-09 20:56
Brandon Ramirez8-Apr-09 20:56 

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.