I want to refactor a function so that I can use it for arrays of different lengths and return that newly created array so that other functions can access it. I can't make the array static since you can't have static arrays with dynamic length. I also can't use a global struct because that needs to take the length of the array and that has to be hardcoded I think. So the question is whether it is even possible to do something like this:
char* splitElementsArr(FILE* file){
int length = countBlankLines(file);
char *arr[length] // or maybe use malloc here
...Some operations to fill array
return arr;