noob to C. I'm not sure why this code is causing the following error:
munmap_chunk(): invalid pointer
This is based on a Kata at https://www.codewars.com/kata/55466989aeecab5aac00003e/train/c. The Kata also throws the following error:
Test Crashed Caught unexpected signal: 6 Completed in 0.0000ms
// C returns a structure named Data.
// array is the returned array.
// sz is array size.
// If from the beginning square length == square width
// return a Data with sz = 0.
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
typedef struct Data Data;
struct Data {
int *array;
int sz;
};
Data* sqInRect(int lng, int wdth) {
// your code
}