Ah I just can't get to grips with the idea of pointers ... but anyway!! It works!! Amazing, thank you ...
While I'm here, by the way ...
Code:
void function_name(FILE *file) {
clock_t start, end;
double dif;
[other assignments]
start = clock(); // we take a time reading from the start of the function
do {
/* if/else, do/while loops etc ... going through my linked list, searching and inserting */
while(pRec != NULL) { /* more code */
}
end = clock();
dif = ( double ) (end - start) / CLOCKS_PER_SEC; // time to run the linked list function
printf ("Reading into a list took %.3lf seconds.\n", dif);
Is this valid code to time how long the function takes to run? Because I'm getting values which are about half what I was expecting them to be ...