Forum: C Dec 1st, 2007 |
| Replies: 4 Views: 2,647 This seems to work here, but when I actually apply it to my algorithm, it fails to sort.
#include <stdio.h>
#include <stdlib.h>
int main()
{
void *array = calloc(10, sizeof(int));
for... |
Forum: C Dec 1st, 2007 |
| Replies: 4 Views: 2,647 I have a version where instead of manipulating the pointers, I keep track of the indices. Then when I want to reference one I simply add the index * size to the base of the array.
So yes, I can... |
Forum: C Dec 1st, 2007 |
| Replies: 4 Views: 2,647 I'm implementing a heapsort on a void array. But I'm having trouble with line 6:
void siftdown(char *start, char *end, size_t size)
{
char *curr = start;
char *child;
while (curr*2 + size... |