-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.c
54 lines (37 loc) · 895 Bytes
/
template.c
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
51
52
53
54
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#define LINES 1000
struct record {
};
int task1(struct record *records);
int task2(struct record *records);
int main(int argc, char **argv)
{
if(argc != 2)
return EXIT_FAILURE;
FILE *stream = fopen(argv[1], "r");
if(stream == NULL)
return EXIT_FAILURE;
struct record *records = calloc(sizeof(struct record), LINES);
if(records == NULL)
return EXIT_FAILURE;
for(int i = 0; i < LINES; i++) {
}
printf("Task1: %d\n", task1(records));
printf("Task2: %d\n", task2(records));
free(records);
return EXIT_SUCCESS;
}
int task1(struct record *records)
{
for(int i = 0; i < LINES; i++) {
struct record rec = records[i];
}
}
int task2(struct record *records)
{
for(int i = 0; i < LINES; i++) {
struct record rec = records[i];
}
}