I put the class in a header file and still get the same error.
Here's the header file:
Code:
const int MAX_ITEMS = 100; // Variable Decleration
typedef int ItemType;
// defining class
class List
{
public:
List();
void SortInfo();
void Print();
private:
int length;
ItemType ItemDB[MAX_ITEMS];
};
And here's the function I get the error in:
Code:
void List::SortInfo()
{
ItemType temp;
int passCount = 0;
int minIndex;
int searchIndex;
for (passCount = 0; passCount < count - 1; passCount++)
{
minIndex = passCount;
for (searchIndex = passCount + 1; searchIndex < count; searchIndex++)
{
if (ItemDB[searchIndex].ItemNumber < ItemDB[minIndex].ItemNumber)
minIndex = searchIndex;
// swap ItemDB[minIndex].ItemNumber with ItemDB[passCount].ItemNumber
temp = ItemDB[minIndex];
ItemDB[searchIndex] = ItemDB[passCount];
ItemDB[passCount] = temp;
} // ends INNER for loop
} // ends OUTER for loop
return;
}
Here's the error being generated:
C:\c++\Project2_beta2\Project2_beta2\Project2_beta 2.cpp(684) : error C2228: left of '.ItemNumber' must have class/struct/union type
Please Help.