Click here to Skip to main content
14,660,820 members
Home » Discussions » Managed C++/CLI
   

Managed C++/CLI

 
QuestionHow to swap address of pointers of 2 variables without using a temporary variable? Pin
Amrit Agr13-Apr-15 20:36
MemberAmrit Agr13-Apr-15 20:36 
AnswerRe: How to swap address of pointers of 2 variables without using a temporary variable? Pin
jschell14-Apr-15 13:17
Memberjschell14-Apr-15 13:17 
AnswerRe: How to swap address of pointers of 2 variables without using a temporary variable? Pin
zhijzan7-Jun-15 20:40
Memberzhijzan7-Jun-15 20:40 
AnswerRe: How to swap address of pointers of 2 variables without using a temporary variable? Pin
Shao Voon Wong28-Jun-15 22:13
mvaShao Voon Wong28-Jun-15 22:13 
Questionhow to migrate CORBA to Web Service in C++ Pin
VC_RYK13-Apr-15 20:20
MemberVC_RYK13-Apr-15 20:20 
Questionconsumer.C: In function âint main(int, char**)â: consumer.C:69: error: invalid conversion from âvoid (*)(buffer_t*, char)â to âvoid* (*)(void*)â consumer.C:69: error: initializing argument 3 of âint pthread_create(pthread_t*, const pthread_attr_t*, Pin
Member 1160464113-Apr-15 15:29
MemberMember 1160464113-Apr-15 15:29 
AnswerRe: consumer.C: In function âint main(int, char**)â: consumer.C:69: error: invalid conversion from âvoid (*)(buffer_t*, char)â to âvoid* (*)(void*)â consumer.C:69: error: initializing argument 3 of âint pthread_create(pthread_t*, const pthread_attr Pin
Richard MacCutchan13-Apr-15 21:33
mveRichard MacCutchan13-Apr-15 21:33 
Questionint **p = (int**)new int(5); Confusing !!! Pin
Amrit Agr5-Apr-15 8:32
MemberAmrit Agr5-Apr-15 8:32 
Hey Guys,

I am trying to execute the following chunk of code.

int **p = (int**)new int(5);
cout << *p;

I am getting output 00000005

As per my understanding , we don't need to typecast return value from new, as it automatically does.
Like in the following statement

int *ap = new int(20);

We don't need to do that, So why I need to do in case of double pointer??

Second thing is, in cout statement, I need to put pointer deference operator once not twice. Even after that i am getting strange output like 00000005

Please someone help me.

Thanks
Amrit
AnswerRe: int **p = (int**)new int(5); Confusing !!! Pin
Richard Andrew x645-Apr-15 10:14
professionalRichard Andrew x645-Apr-15 10:14 
AnswerRe: int **p = (int**)new int(5); Confusing !!! Pin
Zabir Al Nazi Nabil5-Apr-15 11:34
professionalZabir Al Nazi Nabil5-Apr-15 11:34 
Questionsolitaire game Pin
Member 115602925-Apr-15 4:19
MemberMember 115602925-Apr-15 4:19 
AnswerRe: solitaire game Pin
Richard MacCutchan5-Apr-15 5:39
mveRichard MacCutchan5-Apr-15 5:39 
QuestionFast object tracking code Pin
Member 1051522512-Mar-15 22:35
professionalMember 1051522512-Mar-15 22:35 
Questionhow to use hook for mouse simulation Pin
Omarkkk10-Mar-15 2:02
MemberOmarkkk10-Mar-15 2:02 
AnswerRe: how to use hook for mouse simulation Pin
Richard MacCutchan10-Mar-15 6:04
mveRichard MacCutchan10-Mar-15 6:04 
GeneralRe: how to use hook for mouse simulation Pin
Omarkkk10-Mar-15 6:08
MemberOmarkkk10-Mar-15 6:08 
GeneralRe: how to use hook for mouse simulation Pin
Richard MacCutchan10-Mar-15 6:28
mveRichard MacCutchan10-Mar-15 6:28 
GeneralRe: how to use hook for mouse simulation Pin
Omarkkk10-Mar-15 6:37
MemberOmarkkk10-Mar-15 6:37 
GeneralRe: how to use hook for mouse simulation Pin
Richard MacCutchan10-Mar-15 6:58
mveRichard MacCutchan10-Mar-15 6:58 
GeneralRe: how to use hook for mouse simulation Pin
Omarkkk10-Mar-15 7:03
MemberOmarkkk10-Mar-15 7:03 
GeneralRe: how to use hook for mouse simulation Pin
Richard MacCutchan10-Mar-15 7:10
mveRichard MacCutchan10-Mar-15 7:10 
GeneralRe: how to use hook for mouse simulation Pin
Omarkkk10-Mar-15 7:20
MemberOmarkkk10-Mar-15 7:20 
GeneralRe: how to use hook for mouse simulation Pin
Richard MacCutchan10-Mar-15 7:37
mveRichard MacCutchan10-Mar-15 7:37 
Questionprogram is crash. help me Pin
dongchul-lee25-Feb-15 20:12
Memberdongchul-lee25-Feb-15 20:12 
SuggestionRe: program is crash. help me Pin
Richard MacCutchan25-Feb-15 21:41
mveRichard MacCutchan25-Feb-15 21:41 

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.