- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimer.c
More file actions
Latest commit
50 lines (32 loc) · 893 Bytes
/
Copy pathtimer.c
File metadata and controls
50 lines (32 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include"timer.h"
intmain(intargc, char**argv) {
charzero=1;
ROUTEr;
FILE*f=fopen("test.dat", "wb");
if (f==NULL) { // if file not found, tell them
printf("Error opening f\nClosing program.\n");
return; // and quit
}
fwrite(&zero, sizeof(zero), 1, f);
fclose(f);
read_splits(&r, "test.dat");
return0;
}
voidwrite_splits(ROUTE*route, char*filename) {
}
voidread_splits(ROUTE*route, char*filename) {
charinput;
inti;
FILE*f=fopen(filename, "rb+");
if (f==NULL) { // if file not found, tell them
printf("Error opening %s\nClosing program.\n", filename);
return; // and quit
}
fread(&input, 1, 1, f);
route->num_splits=input;
printf("num_splits is %d\n", route->num_splits);
for (i=0; i<route->num_splits; i++) {
fread(&(route->splits[i]), sizeof(SPLIT), 1, f);
// printf("readddinnng!!!\n");
}
}