class arrayListType
{
int main();
public:
int intlist;
void insertAt(int location, int insertItem);
void insertEnd(int insertItem);
int seqSearch(int searchItem) const;
void remove(int removeItem);
int min(int first, int last);
int max(int first, int last);
//Constructor
1. Read the first error message
2. Go to the line it is talking about
3. Read the first error message again
4. Fix it
5. Recompile the code
6. Go back to step 1
If you want help, please edit your post and make sure your code is [code]between code tags[/code] - this will give it line numbers and syntax highlighting. Also, we need to know which lines those errors are referring to - just the errors themselves without line numbers is not useful.
#ifndef unorderedArrayListType
#define unorderedArrayListType
#include "arrayListType.h"
class unorderedArrayListType::public arrayListType
{
public:
int intList;
void insertAt(int location, int insertItem);
void insertEnd(int insertItem);
void replaceAt(int location, int repItem);
void remove(int removeItem);
void removeAt(int location);
void removeAll();
int min(int first, int last);
int max(int first, int last);
//Constructors
}
#endif
Error 1 error C2236: unexpected token 'class'. Did you forget a ';'? Line 5
Error 2 error C2589: 'public' : illegal token on right side of '::' Line 5
Error 3 error C1903: unable to recover from previous error(s); stopping compilation Line 5
Error 1 error C2236: unexpected token 'class'. Did you forget a ';'? Line 5
As the error suggests, you probably forgot a semicolon - where? Probably near the end of your arrayListType.h file. If you can't figure out where, post the last 15 lines from it.
Error 2 error C2589: 'public' : illegal token on right side of '::' Line 5
You accidentally typed two colons instead of one colon.
#include <iostream>
#include "unorderedArrayListType.h"
usingnamespace std;
int main()
{
unorderedArrayListType intList(8);
int number;
cout << "Enter 8 Integers: ";
for (int count = 0; count < 8; count++)
{
cin >> number;
intList.insertEnd(number);
}
cout << endl;
cout << "Int List";
intList.print();
cout << endl;
cout << "The smallest number in IntList: ";
intList.print(5);
cout << endl;
}
Warning 4 warning C4094: untagged 'class' declared no symbols Line 4
Error 5 error C2143: syntax error : missing ';' before 'using' Line 4
Error 6 error C3861: 'intList': identifier not found Line 9
: 'intList' : undeclared identifier Line 16
Error 8 error C2228: left of '.insertEnd' must have class/struct/union Line 16
Error 9 error C2065: 'intList' : undeclared identifier Line 21
Error 10 error C2228: left of '.print' must have class/struct/union Line 21
Error 11 error C2065: 'intList' : undeclared identifier Line 25
Error 12 error C2228: left of '.print' must have class/struct/union Line 25
#include <iostream>
#include "unorderedArrayListType.h";
usingnamespace std;
int main()
{
unorderedArrayListType; intList(8);
int number;
cout << "Enter 8 Integers: ";
for (int count = 0; count < 8; count++)
{
cin >> number;
intList.insertEnd(number);
}
cout << endl;
cout << "Int List";
intList.print();
cout << endl;
cout << "The smallest number in IntList: ";
intList.print(5);
cout << endl;
}
Warning 4 warning C4094: untagged 'class' declared no symbols Line 4
Error 5 error C2143: syntax error : missing ';' before 'using' Line 4
Error 6 error C3861: 'intList': identifier not found Line 9
Error 7 error C2065: 'intList' : undeclared identifier Line 16
Error 8 error C2228: left of '.insertEnd' must have class/struct/union Line 16
Error 9 error C2065: 'intList' : undeclared identifier Line 21
Error 10 error C2228: left of '.print' must have class/struct/union Line 21
Error 11 error C2065: 'intList' : undeclared identifier Line 25
Error 12 error C2228: left of '.print' must have class/struct/union Line 25
class unorderedArrayListType::public arrayListType
{
public:
int intList;
void insertAt(int location, int insertItem);
void insertEnd(int insertItem);
void replaceAt(int location, int repItem);
void remove(int removeItem);
void removeAt(int location);
void removeAll();
int min(int first, int last);
int max(int first, int last);
//Constructors
};// <- the semicolon belongs here *************
Remove the ; you placed after line 2 in your last post.
#include <iostream>
usingnamespace std;
int main()
{
unorderedArrayListType intList(8);
int number;
cout << "Enter 8 Integers: ";
for (int count = 0; count < 8; count++)
{
cin >> number;
intList.insertEnd(number);
}
cout << endl;
cout << "Int List";
intList.print();
cout << endl;
cout << "The smallest number in IntList: ";
intList.min(5);
cout << endl;
}
Error 4 error C2065: 'intList' : undeclared identifier Line 15
Error 6 error C2065: 'intList' : undeclared identifier Line 20
Error 8 error C2065: 'intList' : undeclared identifier Line 24
Error 1 error C2065: 'unorderedArrayListType' : undeclared identifier Line 8
Error 2 error C2146: syntax error : missing ';' before identifier 'intList' Line 8
Error 5 error C2228: left of '.insertEnd' must have class/struct/union Line 15
Error 9 error C2228: left of '.min' must have class/struct/union Line 24
Error 7 error C2228: left of '.print' must have class/struct/union Line 20
Error 3 error C3861: 'intList': identifier not found Line 8
10 IntelliSense: identifier "unorderedArrayListType" is undefined Line 8