Click here to Skip to main content
15,914,111 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionDetecting sql server and db2 Pin
saqib823-Jan-07 18:56
saqib823-Jan-07 18:56 
AnswerRe: Detecting sql server and db2 Pin
Christian Graus3-Jan-07 19:03
protectorChristian Graus3-Jan-07 19:03 
AnswerRe: Detecting sql server and db2 Pin
bsaksida4-Jan-07 22:32
bsaksida4-Jan-07 22:32 
QuestionClarify malloc() and free() Pin
Reagan Conservative3-Jan-07 9:34
Reagan Conservative3-Jan-07 9:34 
AnswerRe: Clarify malloc() and free() Pin
Christian Graus3-Jan-07 10:52
protectorChristian Graus3-Jan-07 10:52 
GeneralRe: Clarify malloc() and free() Pin
Reagan Conservative3-Jan-07 11:26
Reagan Conservative3-Jan-07 11:26 
GeneralRe: Clarify malloc() and free() Pin
led mike5-Jan-07 4:58
led mike5-Jan-07 4:58 
Questionbeginner in c++ Pin
ellarond2-Jan-07 20:41
ellarond2-Jan-07 20:41 
AnswerRe: beginner in c++ Pin
Jun Du3-Jan-07 1:22
Jun Du3-Jan-07 1:22 
QuestionRunning a C++/CLI dll from C# Pin
Christian Graus2-Jan-07 0:20
protectorChristian Graus2-Jan-07 0:20 
AnswerRe: Running a C++/CLI dll from C# Pin
bsaksida2-Jan-07 7:25
bsaksida2-Jan-07 7:25 
GeneralRe: Running a C++/CLI dll from C# Pin
Christian Graus2-Jan-07 10:10
protectorChristian Graus2-Jan-07 10:10 
AnswerRe: Running a C++/CLI dll from C# [modified] Pin
led mike2-Jan-07 10:22
led mike2-Jan-07 10:22 
GeneralRe: Running a C++/CLI dll from C# Pin
Christian Graus2-Jan-07 15:44
protectorChristian Graus2-Jan-07 15:44 
QuestionMoving The Mouse Then Clicking It's Button ? Pin
Fritzables1-Jan-07 12:32
Fritzables1-Jan-07 12:32 
AnswerRe: Moving The Mouse Then Clicking It's Button ? Pin
Christian Graus1-Jan-07 23:54
protectorChristian Graus1-Jan-07 23:54 
GeneralRe: Moving The Mouse Then Clicking It's Button ? Pin
Fritzables2-Jan-07 0:29
Fritzables2-Jan-07 0:29 
QuestionMessage Removed Pin
1-Jan-07 7:58
Armond Sarkisian1-Jan-07 7:58 
AnswerRe: A Little Bit Confused... Pin
Xpnctoc1-Jan-07 9:20
Xpnctoc1-Jan-07 9:20 
I know where the problem is, but let's see if I can word an explanation and make it understandable:

As you know, when you send a value parameter to a function, a copy of that value is made. For instance, changing your function signature to someFunction(int i) would mean that a copy of the value stored in "i" is made. Therefore any changes made to "i" in the function itself would not be saved. The way to get around this is, of course, to pass an address or pointer. Your someFunction(int* p) allows you to change the value stored in p.

When you pass a pointer, instead of a copy of the value being made, a copy of the pointer is made. The type "int*" means you can change the value stored at the int location, but you cannot change the address itself. In assigning NULL, you are of course trying to change the address the pointer points to. However, since a copy of the pointer is made, you are only changing the address the copy points to, and not the address the incoming pointer points to.

In otherwords, if you expect to change the actual address of where the pointer points to, you have to pass to the function a pointer to the pointer. The following revised function should work for you:

void someFunction(int** pp)
{
*pp = NULL;
}

Then when you call the function:

someFunction(&p);


AnswerRe: A Little Bit Confused... Pin
bsaksida1-Jan-07 10:35
bsaksida1-Jan-07 10:35 
QuestionHandle vs. pointer access speed??? Pin
Xpnctoc31-Dec-06 19:22
Xpnctoc31-Dec-06 19:22 
AnswerRe: Handle vs. pointer access speed??? Pin
bsaksida1-Jan-07 2:27
bsaksida1-Jan-07 2:27 
GeneralRe: Handle vs. pointer access speed??? Pin
Xpnctoc1-Jan-07 4:28
Xpnctoc1-Jan-07 4:28 
GeneralRe: Handle vs. pointer access speed??? Pin
bsaksida1-Jan-07 4:37
bsaksida1-Jan-07 4:37 
GeneralRe: Handle vs. pointer access speed??? Pin
Xpnctoc1-Jan-07 5:18
Xpnctoc1-Jan-07 5:18 

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.