|
From: mofana m. <mo...@nu...> - 2016-03-18 09:47:41
|
There must be corresponding
#if...
before your
#endif // LinkedQueue_H
>
>> I am using Dev C++ version 4.9.9.2 w/ Windows XP. I am writing a
>> program for class that requires me to use inheritance. Below is
>> the header files for the base class and the derived class.
>>
>> BASE CLASS:
>>
>> #include<iostream>
>> #include<iomanip>
>> #include<stdlib.h>
>>
>> using namespace std;
>>
>> #include "Node.h"
>>
>> class Queue
>> {
>> protected:
>> NodePtr Front;
>> NodePtr Rear;
>> int Count;
>> void QueueError(char* Mesg);
>> public:
>> Queue();
>> ~Queue();
>>
>> void displayAll();
>> void addRear(int item);
>> void deleteFront(int& item);
>> int getSize();
>> bool isEmpty();
>> bool full();
>> };
>>
>> #endif // LinkedQueue_H
>>
>> DERIVED CLASS:
>>
>> #ifndef LinkedList_H
>> #define LinkedList_H
>>
>> #include<iostream>
>> #include<iomanip>
>> #include<stdlib.h>
>>
>> using namespace std;
>>
>> class LL: public Queue
>> {
>>
>> public:
>> void addFront(int NewNum);
>> void deleteRear(int& OldNum);
>> int search(int& Key);
>> void deleteIth(int I, int& OldNum);
>>
>> };
>> #endif //LinkedList_H
>>
>> COMPILE LOG:
>>
>> Compiler: Default compiler
>> Building Makefile: "C:\Documents and
>> Settings\Von\Desktop\HW3\Pt2\Makefile.win"
>> Executing make...
>> make.exe -f "C:\Documents and
>> Settings\Von\Desktop\HW3\Pt2\Makefile.win" all
>> g++.exe -c LinkedList.cpp -o LinkedList.o
>> -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"
>> -I"C:/Dev-Cpp/include/c++/3.4.2/backward"
>> -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"
>> -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
>>
>> In file included from LinkedList.cpp:10:
>> LinkedList.h:11: error: expected class-name before '{' token
>>
>> make.exe: *** [LinkedList.o] Error 1
>>
>> Execution terminated
>>
>>
---
-------------------------------------------
mofana mphaka
Mathematics and Computer Science Department
National University of Lesotho
LESOTHO
mailto:mof...@gm...; cc: mo...@nu...
http://cs.nul.ls/~mofana
Cell: (+266) 63167562
Office: (+266) (5221)3518
Home: (+266) 27058532
---------------------------------------------------------------------------
|