diff --git a/assignment8.txt b/assignment8.txt new file mode 100644 index 0000000..2d5b86a --- /dev/null +++ b/assignment8.txt @@ -0,0 +1,7 @@ +1. I think that the program will crash and if it runs smoothly, it will probably output ABCabc123 + +2. 3 bytes as indicated by the code that argc ! = 3 + +3. NONE + +4. free(p); \ No newline at end of file diff --git a/sort.c b/sort.c new file mode 100644 index 0000000..36620ba --- /dev/null +++ b/sort.c @@ -0,0 +1,39 @@ +//Justin Yu// +//This is definitely not completed but I couldn't figure the rest out. Sorry.// + +#include +#include +#include + +int main() { + + srand(time(NULL)); + int num; + int i; + int *array + int *arrayAscend; + int *arrayDescend; + + printf("Enter number of integers\n"); + scanf("%d", &num); + + array = (int*) malloc(sizeof(int)*num); + arrayAscend = (int*) malloc(sizeof(int)*num); + arrayDescend = (int*) malloc(sizeof(int)*num); + + for(i = 0; i < num; i++) { + arrayAscend[i] = array[i]; + arrayDescend[i] = array[i]; } + + for(i = 0; i < num; i++) { + for(int j = 0; k < num - 2; j++) + + + // I'm not sure what to add here// + + + free(array); + free(arrayAscend); + free(arrayDescend); + +