FileHandler.cpp
/**
 * Reads an array of numbers from the binary file
 * @param pFile The binary file pointer
 * @param start Position to start reading data from
 * @param length The length of data to be read
 * @return The array of integers read from the file
 */
Reads an array of numbers from the binary file
@param pFile The binary file pointer
@param start Position to start reading data from
@param length The length of data to be read
@return The array of integers read from the file
Reads an array of numbers from the binary file @param pFile The binary file pointer @param start Position to start reading data from @param length The length of data to be read @return The array of integers read from the file
int *FileHandler::readNumbers(std::FILE *pFile, int start, int length) {
    static int* result;
    result = (int*) malloc(length * sizeof(int));
    std::fill_n(result, length, -1);
    std::fseek(pFile, sizeof(int) * start, SEEK_SET);
    for (int i = 0; i < length; i++){
        std::fread(&result[i], sizeof(int), 1, pFile);
    }
    return result;
}
int * FileHandler :: readNumbers ( std :: FILE * pFile , int start , int length ) { static int * result ; result = ( int * ) malloc ( length * sizeof ( int ) ) ; std :: fill_n ( result , length , -1 ) ; std :: fseek ( pFile , sizeof ( int ) * start , SEEK_SET ) ; for ( int i = 0 ; i < length ; i ++ ) { std :: fread ( & result [ i ] , sizeof ( int ) , 1 , pFile ) ; } return result ; }
Reads an array of numbers from the binary file
 @param pFile The binary file pointer
 @param start Position to start reading data from
 @param length The length of data to be read
 @return The array of integers read from the file
Reads an array of numbers from the binary file @param pFile The binary file pointer @param start Position to start reading data from @param length The length of data to be read @return The array of integers read from the file
// Must be in heap because of the non-constant array size.