I have a structured piece of code that i am converting into object orientated, the structured code contains a stuct;
This struct needs to be included in the OO code as it is a part of the functions - now member functions.
So far the class i have defined for the OO code is;
Problem - the constructor is not working properly, i define the member function;
OpAmpDb::OpAmpD b()
and get an error that i cannot redeclare it! I am very confused about this, not quite sure where to put my struct definition in the new OO code or why my constructor will not work!!
Please help!!
Code:
struct OpAmps {
char Name[20]; // the name of the op-amp (e.g. "741")
unsigned int PinCount; // the number of pins in the package
double SlewRate; // the slew rate in volts per microsecond
};
This struct needs to be included in the OO code as it is a part of the functions - now member functions.
So far the class i have defined for the OO code is;
Code:
class OpAmpDb
{
public:
OpAmpDb();
void Enter(OpAmps&, unsigned long&);
void Save(const OpAmps*, unsigned long);
void Load(OpAmps*, unsigned long&);
void Sort(OpAmps*, unsigned long);
int SortName(const void*, const void*);
int SortSlewRate(const void*, const void*);
void Display(const OpAmps*, unsigned long);
private:
int Num;
};
OpAmpDb::OpAmpD b()
and get an error that i cannot redeclare it! I am very confused about this, not quite sure where to put my struct definition in the new OO code or why my constructor will not work!!
Please help!!
Comment