prain
asked on
Template question. I really do not understand what this wants....
OK. I have a Template....
template<typename T>
class LookupTable2
{
public:
LookupTable2 (void);
unsigned int getRows (void) const;
private:
std::vector<std::vector<T> > table2_; ///< Create table object.
};
Then I have another class that inherits the above....
};
#include "LookupTable2.h"
#include <iostream>
#include <vector>
#include <cmath>
template<typename T>
class LookupTable3 : public LookupTable2 <T>
{
public:
LookupTable3<T> (void);
void printAttributes (void);
private:
std::vector<LookupTable2<T > > table3_; // Create table object.
};
Then I have a main() in a driver
#include <iostream>
#include "LookupTable3.h"
using namespace std;
int main (void)
{
unsigned int nRow, nCol;
LookupTable2<float> table2iv();
table2iv.getColumns();
LookupTable3<float> table3iv();
table3iv.printAttributes() ;
return 0;
}
I am getting an error in both
table2iv.getColumns();
LookupTable3<float> table3iv();
in the main. The error is error C2228: left of '.getColumns' must have class/struct/union type
What is this asking. I do not understand.....Can some one tell me what?
template<typename T>
class LookupTable2
{
public:
LookupTable2 (void);
unsigned int getRows (void) const;
private:
std::vector<std::vector<T>
};
Then I have another class that inherits the above....
};
#include "LookupTable2.h"
#include <iostream>
#include <vector>
#include <cmath>
template<typename T>
class LookupTable3 : public LookupTable2 <T>
{
public:
LookupTable3<T> (void);
void printAttributes (void);
private:
std::vector<LookupTable2<T
};
Then I have a main() in a driver
#include <iostream>
#include "LookupTable3.h"
using namespace std;
int main (void)
{
unsigned int nRow, nCol;
LookupTable2<float> table2iv();
table2iv.getColumns();
LookupTable3<float> table3iv();
table3iv.printAttributes()
return 0;
}
I am getting an error in both
table2iv.getColumns();
LookupTable3<float> table3iv();
in the main. The error is error C2228: left of '.getColumns' must have class/struct/union type
What is this asking. I do not understand.....Can some one tell me what?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.