c6386 buffer overrun while writing
问题 Function Name: expandStack Input: a pointer to a Stack type (Stack*) Output: none Function Operation: The function expands a stack void expandStack(Stack* stack){ //Check the stack and the array are allocated if (stack == NULL ||stack->content == NULL) { return; } //Allocating a new sized array (*2 from the previous) Element* expandedStack = (Element*)malloc(2 * (stack->size) * sizeof(Element)); //Case malloc failed if (expandedStack == NULL) { printf("Error! Malloc has failed in file 'stack