I should start off by saying that this is my first time posting on this (or any) C programming forum. I really don't like not being able to finish something by myself, but I am stuck and can't seem to come up with a solution. What my code is trying to accomplish is to take a single integer from the command line and find all integer partitions including mirrored partitions. For example if 4 were entered it should break into [1,3] [2,2] [3,1] [1,1,2] [1,2,1] [2,1,1] [1,1,1,1] and [4]. I have tried several different solutions, but every one I try either fails when larger integers are input (anything > 5 wouldn't output all partitions) or it prints several duplicate partitions. I've pretty much scraped everything and started from scratch. What I'm trying now is just storing every number that the input integer would break down to, into an array. So if 4 were entered, the array would hold [4,1,3,1,2,1,1]. That array is then sent to another function that, in theory, will form a second array. This array will start with any combination of 1 element that sums to the input number (n), and then print those elements. The function would then recurse and the new array would send all combinations of 2 elements that sum to n. Then any combination of 3 elements, so on until it gets to n elements (elements can be added with themselves), then the program will stop. I have two major issues though. First, I can't figure out how to get this new theoretical function of mine to work (as you can see in the code, there is really no progress made on that function). Second, this solution seems like it would take far too much processing time to be practical, so if you have any ideas that are completely different from my current idea, please let me know. Any help you all could give would be greatly appreciated. Thank so much, and without further ado, the code thus far...

Thanks so much!Code:#include <stdio.h> #include <stdlib.h> void part(int, int[], int); void printarray(int, int[]); void permutations(int, int[], int[]); int main (int argc, char *argv[]) { int num = atoi(argv[1]); int * out = calloc((num*2)-1, sizeof(int)); int * temp = calloc((num), sizeof(int)); int i = 1; out[0] = num; part(num, out, i); permutations(num, out, temp); free(out); return 0; } void part (int n, int out[], int i) { out[i] = 1; if ([n-1] = 0) { return; } else { out[i++] = [n--]; part(n, out, i); } } void printarray(int n, int out[]) { int x; printf("["); for(x = 0;x < n;x++) { if (out[x+1] < 1) { printf("%d]\n",out[x]); } else if(out[x] < 1) { x = n; } else { printf("%d ",out[x]); } } } void permutations(int n, int out[], int temp[]) { int x; int y; int z; for(x = 1; x < n; x++) {