I keep getting errors and i dont know what im doing wrong.I've included just pieces of these three files. The compiler is giving me errors and i dont know what's wrong.
this is my header file List.h not all but some of it.
#include <iostream>
using namespace std;
#ifndef INTEGERLIST_H
#define INTEGERLIST_H
template <class T>
class List
{
public:
List(int sz); //Constructor create array with sz capacity
//The big three
~List(); //Destructor
List(const List &initList); //Copy constructor
List &operator=(const List &rightSide); //Assigment operator
//Name: getSize
//Description: returns the number of elements in the array
//Parameteres: none
//Return: number of elements in the array
int getSize() const;
This is my implementation file list.cpp
#include "list.h"
#include <iomanip>
using namespace std;
template <class T >
List::List(int sz) //Constructor creates array with capacity sz
{
numElements = sz;
list = new T [sz];
}
This is my application file
#include "list.cpp"
#include "list.h"
#include <iostream>
#include <fstream>
using namespace std;
void initializeList(List<char> &array);
void printList(List<char> array);
void updateItem(List<char> &array);
int menu();
int main()
{
List<char> myList(10);