Recent content by cubanmissile
-
C
C Programming: Creating recursive quickSort function
Actually, it was my sort function that was causing the quickSort to not work. :) Thank you guys very much for the help! Programming is fun (not sarcasm, I truly love programming)!- cubanmissile
- Post #4
- Forum: Engineering and Comp Sci Homework Help
-
C
C Programming: Creating recursive quickSort function
Homework Statement Function: void quickSort(struct student *array, int start, int end) { int i = start; int j = end; while(i < j) { // Move left counter, then right counter. while(i <= end && array[i].numDays <= array[start].numDays) i++; while(array[j].numDays >...- cubanmissile
- Thread
- C programming Function Programming
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
C
C Programming: freeing array of structs causes heap overflow
To answer your points, which are ALL valid and I hope others read this! 1. I did account for null character, assignment says name can be as long as 29 characters (guaranteed) so NAMELENGTH is 30. 2. You are CORRECT! I was calling my sort array using the end index as "students" instead of...- cubanmissile
- Post #5
- Forum: Engineering and Comp Sci Homework Help
-
C
C Programming: freeing array of structs causes heap overflow
Wouldn't that call an error when trying to write said index? I'll check that out, you bring up a valid point, thank you! :) EDIT: You are correct! For some odd reason my sorting function is calling the swap function with an index too big! I didn't think of checking it, that means my sorting...- cubanmissile
- Post #3
- Forum: Engineering and Comp Sci Homework Help
-
C
C Programming: freeing array of structs causes heap overflow
Homework Statement Error: warning: HEAP[Happy Birthday.exe]: warning: Heap block at 006E15A8 modified at 006E1688 past requested size of d8 My Struct: struct student { // Defines a student. char firstName[NAMELENGTH], lastName[NAMELENGTH]; int day, month, year; }; My Code...- cubanmissile
- Thread
- Array C programming Programming
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help