I'm currently creating an array of structs, and when i initialize the array, it is starting with 8 elements in the struct, instead of 1. Why is it doing this? If more code is needed (but i doubt it as they are all seperate functions, i can post it if asked) This is the relevant bits of code:
typedef struct {
int valid;
int row, col;
} Point;
typedef struct {
Point point;
int number;
char name;
char param[20];
char type[20];
} Agent;
int main(int argc, char **argv)
{
int steps;
int listSize = 0;
Agent *agentList = (Agent *) calloc(1, sizeof(Agent));
printf("%d size of agentList when initialised\n", sizeof(agentList));
if (argc != 4) {
error(SHOW_USAGE);
}
sscanf(argv[2], "%d", &steps);
if ((steps < 1)) {
error(BAD_STEPS);
}
readMap(argv[1]);
agentList = readAgentFile(argv[3], agentList);
print_agents(agentList);
return 0;