Home > Back-end >  Malloc is triggered when the breakpoint
Malloc is triggered when the breakpoint

Time:10-11


Void QueueAppend (LQueue * Q, int x)
{
LQNode * p=(LQNode *) malloc (sizeof (LQNode *)); + + + + + + + + + + + + + + +

P - & gt; Data=https://bbs.csdn.net/topics/x;
P - & gt; next=NULL;

If (Q - & gt; Rear!=NULL)
Q - & gt; Rear - & gt; Next=p;
Q - & gt; Rear=p;
If (Q - & gt; Rear==NULL)
Q - & gt; The front==p;
}

A void RadixSort (int * and an int n, m int, int d)
{
Int I, j, k, power=1;
LQueue * tub;
Tub=(LQueue *) malloc (sizeof (LQueue) * d);

for(i=0; i QueueInitiate (& amp; Tub [I]);
for(i=0; i If (I==0)
Power=1;
The else
Power=power * d;
For (j=0; j K=a [j]/power - (a) [j]/(power * d)) * d;
QueueAppend (& amp; Tub [k], a [j]); + + + + + + + + + + +
}

K=0;
For (j=0; j While (QueueNotEmpty (tub) [j].=0) {
QueueDelete (& amp; Tub [j], & amp; A, [k]).
k++;
}
}
}

I use RadixSort call QueueAppend but debugging to mark the + + + + + statements occurs after the breakpoint, the compiler is vs2012

CodePudding user response:

LQNode * p=(LQNode *) malloc (sizeof (LQNode * ));
=========================
Application is a pointer, wrong, should be a structure

CodePudding user response:

reference 1st floor yshuise response:
LQNode * p=(LQNode *) malloc (sizeof (LQNode * ));
=========================
Application of pointer, wrong, should be structure

Modified or trigger breakpoints

CodePudding user response:

reference 1st floor yshuise response:
LQNode * p=(LQNode *) malloc (sizeof (LQNode * ));
=========================
Application of pointer, wrong, should be structure

QueueAppend execution will not trigger the breakpoints in the main function, in RadixSort when triggered
  • Related