samples/load_model.c
void* ReadInput(const char* input_file)
{
    void* buffer;
    FILE* file = fopen(input_file, "rb");
    CHECK(file != NULL);
    printf("Reading data from file: %s\n", input_file);

    fseek(file, 0, SEEK_END);
    long length = ftell(file);
    fseek(file, 0, SEEK_SET);
    buffer = malloc((length) * sizeof(char));
    CHECK(buffer != NULL);
    size_t num_read = fread(buffer, sizeof(char), length, file);
    CHECK(num_read == length);
    printf("Input data size: %zu\n", num_read);

    fclose(file);
    return buffer;
}
/*
 * Read input from file
 * Must be free memory after caller of this function
 *
 * @param input_file - name of input file
 * @return - string content of file
 */
Read input from file
Must be free memory after caller of this function

@param input_file - name of input file
@return - string content of file
Read input from file Must be free memory after caller of this function @param input_file - name of input file @return - string content of file
void* ReadInput(const char* input_file)
{
    void* buffer;
    FILE* file = fopen(input_file, "rb");
    CHECK(file != NULL);
    printf("Reading data from file: %s\n", input_file);
    fseek(file, 0, SEEK_END);
    long length = ftell(file);
    fseek(file, 0, SEEK_SET);
    buffer = malloc((length) * sizeof(char));
    CHECK(buffer != NULL);
    size_t num_read = fread(buffer, sizeof(char), length, file);
    CHECK(num_read == length);
    printf("Input data size: %zu\n", num_read);
    fclose(file);
    return buffer;
}
void * ReadInput ( const char * input_file ) { void * buffer ; FILE * file = fopen ( input_file , " " ) ; CHECK ( file != NULL ) ; printf ( " \n " , input_file ) ; fseek ( file , 0 , SEEK_END ) ; long length = ftell ( file ) ; fseek ( file , 0 , SEEK_SET ) ; buffer = malloc ( ( length ) * sizeof ( char ) ) ; CHECK ( buffer != NULL ) ; size_t num_read = fread ( buffer , sizeof ( char ) , length , file ) ; CHECK ( num_read == length ) ; printf ( " \n " , num_read ) ; fclose ( file ) ; return buffer ; }
Read input from file
 Must be free memory after caller of this function
Read input from file Must be free memory after caller of this function