my prof is forcing me to use Two classes from the book we use. Unsorted and Itemtype, i cant alter unsorted functions but i can alter item type. i have copied these 2 classes and tried to compile them in DEV as a project. and they dont compile in DEV, can anyone help me get these to compile and run, i have to use these with another program im developing that compares elements an array of numbers with all permutations of an array <1,-,12> and adds up a total.
Thanks for your help i really appreciate it
In file included from unsortedtype.h:4,
from unsortedtype.cpp:4:
Itemtype.h:11: error: redefinition of `const int max_items'
Itemtype.h:11: error: `const int max_items' previously defined here
Itemtype.h:12: error: multiple definition of `enum relationtype'
Itemtype.h:12: error: previous definition here
Itemtype.h:12: error: conflicting declaration 'LESS'
Itemtype.h:12: error: 'LESS' has a previous declaration as `relationtype LESS'
Itemtype.h:12: error: declaration of `LESS'
Itemtype.h:12: error: conflicts with previous declaration `relationtype LESS'
Itemtype.h:12: error: conflicting declaration 'GREATER'
Itemtype.h:12: error: 'GREATER' has a previous declaration as `relationtype GREATER'
Itemtype.h:12: error: declaration of `GREATER'
Itemtype.h:12: error: conflicts with previous declaration `relationtype GREATER'
Itemtype.h:12: error: conflicting declaration 'EQUAL'
Itemtype.h:12: error: 'EQUAL' has a previous declaration as `relationtype EQUAL'
Itemtype.h:12: error: declaration of `EQUAL'
Itemtype.h:12: error: conflicts with previous declaration `relationtype EQUAL'
Itemtype.h:15: error: redefinition of `class Itemtype'
Itemtype.h:15: error: previous definition of `class Itemtype'
unsortedtype.cpp: In constructor `unsortedtype::unsortedtype()':
unsortedtype.cpp:13: error: expected `;' before '}' token
unsortedtype.cpp: In member function `Itemtype unsortedtype::getitem(Itemtype, bool&)':
unsortedtype.cpp:38: error: `more2seach' undeclared (first use this function)
unsortedtype.cpp:38: error: (Each undeclared identifier is reported only once for each function it appears in.)
unsortedtype.cpp: In member function `void unsortedtype::putitem(Itemtype)':
unsortedtype.cpp:61: error: expected `;' before '}' token
unsortedtype.cpp: At global scope:
unsortedtype.cpp:76: error: declaration of `Itemtype unsortedtype::getnextitem()' outside of class is not definition
unsortedtype.cpp:77: error: expected unqualified-id before '{' token
unsortedtype.cpp:77: error: expected `,' or `;' before '{' token
make.exe: *** [unsortedtype.o] Error 1
Execution terminated
END ERRORS
i have a thought on this , could someone show me a way to turn Itemtype into a struct and stick it into the same file as the Unsortedtype? the id have a class running off a struct.could this solve my errors ?