data structures - An issue with a header in C++ -
i ran problem header. have data structure assignment (linkedlist), , header given int assignment. did other code, when ran program, error appeared regard header! here error:
(the error pointed "private")
- here header:
typedef int elementtype;
struct node { elementtype data; node * next; }; class list { public: list(); //create empty list. bool empty(); //return true if list empty, otherwise return false. void insertatend(elementtype x); //insert value x on end of list. void delete(elementtype x); //if value x in list, remove x. void display(); //display data values in list in order inserted. int smallest(); //find , return smallest value in list. int largest(); //find , return largest value in list. int range() //computer , return range of values in list. private: node * first; //pointer first node. };
on line "int range()
" should "int range();
". in other words, missing semicolon on line, in compiler's view, precedes "private:" keyword.
Comments
Post a Comment