M
Mike Copeland
I'm trying to define and use a class, and I'm confused about what to
do and how to correct the compiler diagnostics I get. Here is the code
I have in my .h file:
class ShadowData
{
public:
char shadowRace; // shadow race event
char realRace; // "real" race event
int shadowBib; // shadow Bib#
int realBib; // "real" Bib#
};
bool shadowBibSort(const ShadowData &d1, const ShadowData &d2)
{
return d1.shadowBib < d2.shadowBib;
}
bool realBibSort(const ShadowData &d1, const ShadowData &d2)
{
return d1.realBib < d2.realBib;
}
typedef vector<ShadowData> ShadowVector;
extern ShadowVector shadowVect;
typedef ShadowVector::iterator shadowIter;
extern ShadowIter shadowIter; // Error on this line!
I get a compiler error on the noted line when I have the following
code in the .cpp file from which I invoke this declaration:
ShadowVector shadowVect; // declare global vector object
ShadowIter shadowIter; // declare global iterator object
I'm embarrassed to admit I can't see what I'm doing wrong. 8<{{
Please advise. TIA
do and how to correct the compiler diagnostics I get. Here is the code
I have in my .h file:
class ShadowData
{
public:
char shadowRace; // shadow race event
char realRace; // "real" race event
int shadowBib; // shadow Bib#
int realBib; // "real" Bib#
};
bool shadowBibSort(const ShadowData &d1, const ShadowData &d2)
{
return d1.shadowBib < d2.shadowBib;
}
bool realBibSort(const ShadowData &d1, const ShadowData &d2)
{
return d1.realBib < d2.realBib;
}
typedef vector<ShadowData> ShadowVector;
extern ShadowVector shadowVect;
typedef ShadowVector::iterator shadowIter;
extern ShadowIter shadowIter; // Error on this line!
I get a compiler error on the noted line when I have the following
code in the .cpp file from which I invoke this declaration:
ShadowVector shadowVect; // declare global vector object
ShadowIter shadowIter; // declare global iterator object
I'm embarrassed to admit I can't see what I'm doing wrong. 8<{{
Please advise. TIA