Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions assignment8.txt
Original file line number Diff line number Diff line change
@@ -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);
39 changes: 39 additions & 0 deletions sort.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//Justin Yu//
//This is definitely not completed but I couldn't figure the rest out. Sorry.//

#include <stdio.h>
#include <time.h>
#include <stdlib.h>

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);