#109391 - dext3r - Fri Nov 17, 2006 11:03 pm
Hello,
I am working on a C program for the DS that keeps track of train station data. I will have about 40 or so stations. This is how I'm storing the data:
I have an array of stationDatas. In my main code I have this:
and so on and so forth...
Is it possible to put this data into a seperate file I can include and compile and link or something? I'd rather not have it in the main source. If station info changes, I'd rather just update the external file and recompile the application. I'd also rather not store the data in a textfile because then i'd have to use a filesystem and I'd want the app to be compatible with a majority of carts.
Thanks for any help you can provide. I've tried googling for info but I'm not sure what this technique is called. Thanks.
dext3r
I am working on a C program for the DS that keeps track of train station data. I will have about 40 or so stations. This is how I'm storing the data:
Code: |
typedef struct { u32 stationID; char *name; char *color; u32 coordx; u32 coordy; char *outbound; u32 outbound_sprite; char *inbound; u32 inbound_sprite; char *outbound_wkday; char *outbound_sat; char *outbound_sun; char *inbound_wkday; char *inbound_sat; char *inbound_sun; char *comments; } stationData; |
I have an array of stationDatas. In my main code I have this:
Code: |
stations[0].name = "Roosevelt"; stations[0].stationID = 1; stations[0].color= "Red"; stations[0].outbound = "95/DanRyan"; stations[0].outbound_sprite = 1; stations[0].inbound = "Howard"; stations[0].inbound_sprite = 4; stations[0].coordx = 100; stations[0].coordy = 100; stations[1].name = "Roosevelt"; stations[1].stationID = 2; stations[1].color= "Green"; stations[1].outbound = "Ashland/63"; stations[1].outbound_sprite = 0; stations[1].inbound = "Harlem"; stations[1].inbound_sprite = 3; stations[1].coordx = 100; stations[1].coordy = 100; |
and so on and so forth...
Is it possible to put this data into a seperate file I can include and compile and link or something? I'd rather not have it in the main source. If station info changes, I'd rather just update the external file and recompile the application. I'd also rather not store the data in a textfile because then i'd have to use a filesystem and I'd want the app to be compatible with a majority of carts.
Thanks for any help you can provide. I've tried googling for info but I'm not sure what this technique is called. Thanks.
dext3r