When I checked the sampleData value in the debug, it said 0x00000000<NULL>
, but it does not fit in the if statement below.Also, NULL!=sampleData will not be processed in the if statement.
HRESULT SampleClass::SampleEvent(SAMPLE_DATA**sampleData)
if(NULL==sampleData)
{
}
It may be quite rudimentary, but does the notation 0x00000000<NULL>
not indicate that the value is NULL?
Or, I don't know if the expression is correct, but does it mean that sampleData does not support NULL?
May I speak to you?
c++ visual-studio
You may not be able to get a clear answer because the questions are somewhat ambiguous.
Why don't you take note of the following and try again.
(1) A project or solution containing the code in question.
Select
Configure Debugging and Build (or Full Build).
And it was successful.
(2) Select "Configure Debugging" or "Start Debugging" as it is (1).
(Note: VS can also be "debugged" in "Configure Release".
In this case, the "watch" result cannot show the actual value.)
(3) There was a breakpoint in the function, where it broke.
(4) Copy the argument "sampleData" to "watch pane" and check the value.
In addition, sampleData was 0x00000000.
(5) and
Global variables of the same name, class member variables of the same name, etc.
It has been verified that it does not exist.
(6) "Step performed" does not fall into the "true" determination of if(NULL==sampleData).
(7) NULL I want to determine is sampleData (=pointer of pointer) and
It is not *sampleData (=pointer).
That is, the code is correct.
I think it would be easier to answer by writing sampleClass and SAMPLE_DATA.
By the way, there was no problem with the following source.
struct SAMPLE_DATA{
inta;
intb;
};
US>classSampleClass{
public:
void SampleEvent(SAMPLE_DATA**sampleData);
};
voidSampleClass::SampleEvent(SAMPLE_DATA**sampleData)
{
if(NULL==sampleData)
{
intaaa=123;
}
}
int main()
{
SampleClass*s = new SampleClass();
s->SampleEvent (NULL);
}
© 2024 OneMinuteCode. All rights reserved.