is there a reason you need it to be in all C?
this seems like it could be a lot cleaner in C++.
Code:
class entry
{
public:
// length of entry
unsigned int points;
// float to hold wavelength, flux and error
float *wl;
float *flux;
float *error;
entry():
wl(new float(6000)),
flux(new float(6000)),
error(new float(6000))
{
}
~entry()
{
delete[] wl;
delete[] flux;
delete[] error;
}
};
int main ( int argc, char *argv[] )
{
try
{
entry *tdata = new entry[439];
}
catch(...)
{
fprintf(stderr, "\nOut of memory");
exit(1);
}
return 0;
}