main.c

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include "vector_utils.h"
#include "tested_declarations.h"
#include "rdebug.h"

int main()
{
    float tab1[100];
    float *vec = tab1;

    int tab2[100];
    int *out = tab2;

    int size = 0, out_size = 0;

    printf("Podaj liczby:\n");
    size = read_vector_float(vec, 100, -1);
    int hist = create_histogram(vec, size, out, 11);
    //int res = create_histogram((float[]){10.909883, 11.074401, 3.334612, 6.534015, 7.303870, 1.743536, 12.604900, 6.693181, 9.176775, 2.222268, 6.606591, 9.204541, 19.677028, 13.429763, 18.692165, 16.231936, 16.504086, 16.632582, 10.321456, 11.601782, 5.401636, 13.452274, 19.634199, 3.102299, 13.949063, 7.967148, 19.176237, 7.508940, 9.173336, 10.858134, 18.240767, 14.766286, 18.207859, 3.780051, 16.733639, 14.132488, 1.015931, 14.103527, 10.985070, 11.390953, 11.929912, 3.419891, 14.934134, 14.733459, 9.473714, 8.188302, 18.721783, 14.850261, 19.477255, 16.614011, 13.541378, 10.313148, 7.845363, 14.976567, 14.300471, 15.421224, 5.258198, 5.256460, 19.167940, 4.208198, 3.060155, 3.419960, 7.216895, 14.923698, 10.348850, 9.850289, 15.115013, 9.715547, 10.955273, 5.206735, 4.129845, 1.399788, 0.886400}, 73, out, 21);

    if(hist == 1)
    {
        printf("Incorrect input");
        exit(1);
    }

    display_vector(out, 11);


    if (size < 0)
    {
        printf("Incorrect input");
        exit(1);
    }

    if (size == 0)
    {
        printf("Not enough data available");
        exit(3);
    }

        return 0;
}