- if (len <= 0) {
- printf("Usage: QuickSort <list of numbers>\n");
- printf("Continuing with default input.\n");
- // fld = new int[] {3, 18, 5, 99, 104, 2};
- fld = (void *)malloc(sizeof(*fld) * (len = 6));
- fld[0] = 3; fld[1] = 18; fld[2] = 5; fld[3] = 99; fld[4] = 104; fld[5] = 2;
- }
- else {
- // Speicher fuer fld erzeugen
- fld = (void *)malloc(sizeof(*fld) * len);
-
- // Feldelemente belegen
- for( i = 0; i < len; i++ )
- fld[i] = atoi(argv[i + 1]);
- }
-
- printf("array: ");
- for(i = 0; i < len; i++) {
- printf("%d, ", fld[i]);
- }