B
Bryan
Okay, in some legacy code, in the .h file I have exactly this:
typedef struct MSObject
{
// this refers to the entire set of data points
double *x;
double *y;
int numValues;
// save zoomed values
double xval_start; // x[first] value in zoom window
double xval_end; // x[last] value in zoom window
int xyindex_start; // first x[index_start] in zoom window
int xyindex_end; // last x[index_end] in zoom window
double Ymin, Ymax; // within zoom window
}MSSpectrum;
// prototypes
int MSObjectReadXY(char *path, MSObject *object);
These are global, and any .c files that include this .h file and use the
MSObject contain also only global functions.
I reallllly want just to add a constructor and destructor to MSObject,
and not have to change the signature of every function that uses this
object.
I have tried every combination of classes, structs, typedefs and
otherwise but nothing will compile that will allow me to add a
constructor to this thing.
What do I need to do?
typedef struct MSObject
{
// this refers to the entire set of data points
double *x;
double *y;
int numValues;
// save zoomed values
double xval_start; // x[first] value in zoom window
double xval_end; // x[last] value in zoom window
int xyindex_start; // first x[index_start] in zoom window
int xyindex_end; // last x[index_end] in zoom window
double Ymin, Ymax; // within zoom window
}MSSpectrum;
// prototypes
int MSObjectReadXY(char *path, MSObject *object);
These are global, and any .c files that include this .h file and use the
MSObject contain also only global functions.
I reallllly want just to add a constructor and destructor to MSObject,
and not have to change the signature of every function that uses this
object.
I have tried every combination of classes, structs, typedefs and
otherwise but nothing will compile that will allow me to add a
constructor to this thing.
What do I need to do?