Home > Back-end >  Data overflow
Data overflow

Time:10-06

Int a=(int) * * * * malloc (B * sizeof (int *));
Int * b=(int *) malloc (A * sizeof (int));
Int * c1=(int *) malloc (A * sizeof (int));
Int c, d, e, f, I, j, A, B, c;
Sizeof (a);
The scanf (" % d ", & amp; A);
The scanf (" % d ", & amp; B);
The scanf (" % d ", & amp; C);
menu();
The scanf (" % d ", & amp; C);
While (1)
{
If (c & gt;=1 & amp; & C & lt;=3) break;
The else
{
Printf (" choose wrong, please choose again: ");
The scanf (" % d ", & amp; C);
}
}
System (" CLS ");
The switch (c)
{
Case 1:
{
For (I=0; i {
Printf (" please enter the player scores \ n ");
Printf (" % d, judge: \ n ", I + 1);
A [I]=(int *) malloc (a * sizeof (int));
For (j=0; J & lt; A; J++)
{
Printf (" % d player scores: ", j + 1);
The scanf (" % d ", & amp; A [I] [j]);
While (1)
{
If (a [I] [j] & gt; 0 & amp; & A [I] [j] <=C) break;
The else
{
Printf (" input error, please re-enter the score (range: 0 to % d) : ", C);
The scanf (" % d ", & amp; A [I] [j]);
}
}
}
System (" CLS ");
}
Printf (" has recorded all grades \ n ");
Printf (" press the return key to return to the level of ");
While (1)
{
If (getch ()=='\ r')
break;
}
System (" CLS ");
Modify data overflow

CodePudding user response:

The a, b, c1 application memory in the front of the code in the menu (), because of a, b, C can not enter, you apply for memory computing memory space is not correct, pay attention to the order of the code,
  • Related