Home > Software engineering >  The debugger, "wrong pointer" how to change?
The debugger, "wrong pointer" how to change?

Time:12-03




MCtrlCode structure,
Excuse me above such mistakes because no structure variable initialization?
If you want to initialize and how to modify?

CodePudding user response:

You this is not a mistake, just member variables uninitialized,
You define a constructor in MCtrlCode, give you initialize the members of the can,

CodePudding user response:

The constructor has not yet been implemented, to look again next step

CodePudding user response:


The constructor is write like this?
 

Node () : x (), STR (), data () {}//parameterless constructor array initialization calls when
The node (int a, string b, char c) : data (a), STR (b), (c) x {}//a structure

CodePudding user response:

Memset (& amp; Testcmd, 0, sizeof (MCtrlCode));

I so initialization, program there is no change, same mistake pointer

CodePudding user response:

Next to the arrow is about to run code, pointing to the line of code is not yet running, didn't call the constructor, wrong Pointers are of course, you try to perform a line

CodePudding user response:






reference 5 floor lidony reply:
beside the arrow is about to run code, pointing to the line of code is not yet running, didn't call the constructor, and of course it is wrong to Pointers, you try to perform a line


I said how sometimes the first three are empty, sometimes is not empty, be this reason,
But when the execution of a program or not,
There are three pointer errors, the three errors of the pointer is cstrings type

CodePudding user response:

CodePudding user response:

And I didn't give the program to add
Memset (& amp; Testcmd, 0, sizeof (MCtrlCode));
Before the initialization code, the program is behind occurred problems, added, after the return here has interrupted

 

BOOL hitted=FALSE;
MCtrlCode testcmd;
Memset (& amp; Testcmd, 0, sizeof (MCtrlCode));
If (m_stopTest=FALSE)
{
MessageBox (_T (" test is performed, cannot be executed again!" ), _T (" test "), MB_OK);
return;
}
M_testcmdlist. The clear ();
M_hitteditemlist. The clear ();
for(int i=0; i{
Hitted=m_motionProgram. HittedItem (I);
If (hitted)
{
M_hitteditemlist. Push_back (I);
}
}
If (m_hitteditemlist. The size () & lt; 1)
{
MessageBox (_T (" no selected test instruction, cannot perform!" ), _T (" test "), MB_OK);
return;
}

CodePudding user response:

Structure is used in the class, do not use memset reset initialization

CodePudding user response:

What should the initialization

CodePudding user response:

Each assignment
Typedef struct _tagTest_t
{
Int a, b;
Cstrings s;
_tagTest_t ()
{
A=0, b=0;
S=_T (" ");
}
} the TEST;

CodePudding user response:

Cstrings is the degree of change!
Using cstrings *
Or
Char [256]
  • Related