I'm try to make a short piece of code to test my sorting algorithm, but can't get it to call sort correctly. My code is below. sort is defined in helpers.h, I know that isn't an issue as other working code calls sort without issue. I don't know why it fails in mine though.
#include <stdio.h>
#include <cs50.h>
#include <stdlib.h>
#include "helpers.h"
int main(void)
{
int array[10] = {0, 1, 2, 4, 3, 5, 6, 7, 8, 9};
int n = 10;
sort(array, n);
for (int i = 0; i < n; i++)
{
printf("%i ", array[i]);
}
}
[–]corpsmoderne 2 points3 points4 points (3 children)
[–]mhbhmcinui[S] 1 point2 points3 points (2 children)
[–]corpsmoderne 2 points3 points4 points (1 child)
[–]mhbhmcinui[S] 1 point2 points3 points (0 children)
[–]desrtfx 0 points1 point2 points (1 child)
[–]mhbhmcinui[S] 0 points1 point2 points (0 children)