comp20003-project02/towers.h

27 lines
604 B
C
Raw Normal View History

#ifndef COMMON_HEADER
#include "common.h"
#endif
#ifndef TOWERS_HEADER
#define TOWERS_HEADER
typedef struct tower {
char *id;
char *postcode;
char *manager;
int population;
double x;
double y;
} tower_t;
2021-09-15 00:06:04 +10:00
/* Reads the current row from the CSV and converts it into a new tower */
void readATower(char *lineBuffer, tower_t *tower);
/* Reads the CSV file and stores the information in the towers array */
tower_t **readTowers(tower_t **towers, FILE *datasetFile, int *numTowers);
/* Frees all towers in a towers array */
void freeTowers(tower_t **towers, int numTowers);
#endif