C function split array into chunks
问题 I have an array of bytes aka unsigned char called content . I want to split my content array into 2 new arrays in a separate function. This function should also determine the size for each of the 2 chunks and allocate memory for them. Also, I want to be able to use both the new arrays and their sizes outside of the function. My implementation is giving me segmentation fault and I must be doing something with pointers wrong. Main function int main(int argc, char *argv[]) { byte *content = NULL