Created
March 16, 2015 01:45
-
-
Save deevus/85827df1a0214da4beec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int | |
load_data(FILE *fp, t_data *ptr_data) { | |
//read into array | |
fread(&ptr_data->n, BINARY_N_LENGTH, 1, fp); | |
//get n | |
int n = extract_little((char *)&ptr_data->n, 0, BINARY_N_LENGTH); | |
//allocate array | |
ptr_data->array = malloc(sizeof(t_double) * n); | |
//read into array | |
fread(ptr_data->array, BINARY_DOUBLE_SIZE, n, fp); | |
return n; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment