For an upcoming Arduino project, I thought it would be handy to define an array of structs as a header file to include in the sketch. Searching for "struct array arduino" turned out to be pretty helpful.

In the first result forum post, the struct is populated in the loop() function.For the header file, I found that the struct array still needs to be populated in a function.

So I created the following function in the header file.

typedef struct{ double Lat; double Long; } RouteData;

#define ROUTEDATALENGTH 2

RouteData RouteArray[ROUTEDATALENGTH];

void DefineRouteArray(){ // For some reason, struct arrays need // to be defined in a function.