So why is my switch not working. I am getting a error here
switch (Sort_Type)
error:'Sort_Type' : illegal use of this type as an expression
#include<iostream>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<cstdio>
#include<fstream>
#include"sortImplementation.cpp"
//void CopyArray( int p[], int q[], int vec);
const int vSize = 3;
using namespace std;
void CopyArray( int p[], int q[], int vec);//this is the function call.
int main()
{
const int Size = 10;
int vec[vSize]={6250,12500,25000};//,50000//,100000,200000,400000};
enum Sort_Type{Quicksort,BubbleSort,SelectionSort,Inser tionsort};
clock_t start,finish;
clock_t startAll;
int loBound=0;
int hiBound=vSize-1;
quick qq;
int Numberstobesorted[] = {3,7,8,9,70,45,12,5,66,87};
int Numbers=0;
double duration;
int j=0;
int *p, *q;//p and q are the pointers to arrays.
int iSize = 0;
int i=0;
int* a;
// Size = Numberstobesorted[i];
a = new int[Size];
ifstream inFile;
ofstream outFile;
inFile.open("input1.txt");
outFile.open("output1.txt");
for(i =0; i<Size; i++)
{
qq.BubbleSort(a,iSize );
}
for(i =0; i<Size; i++)
{
qq.BubbleSort(a,iSize );
outFile<<Numberstobesorted[i]<<" ";
}
cout<<" "<<"Bubble Sort"<<" "<<"Insertion"<<" "<<"Quick"<<" "<<"Selection"<<endl;
//return 0;
//}
for(i=0; i<vSize; i++)
{
iSize = vec[i];
p = new int[iSize];
q = new int[iSize];
for(int k = 0; k<vec[i]; k++)
{
p[k]=rand();
}
for(int ii=0; ii<=3;ii++)
{
memcpy(q, p, iSize*4);
start=clock();
switch (Sort_Type)
{
case 0:
hiBound = iSize - 1;
qq.Quicksort(q,loBound,hiBound);
break;
case 1:
qq.BubbleSort(q, iSize );
break;
case 2:
qq.SelectionSort(q, iSize);
break;
case 3:
qq.Insertionsort(q, iSize);
break;
default: cout<<"Error"; break;
}//end of switch function.
finish=clock();
duration=(double)(finish-start)/CLOCKS_PER_SEC;
cout<<" "<<setw(4)<<duration;
}
//Delete the array for the next sorting function.
cout<<endl;
delete[] p;
delete[] q;
}
//cout<<duration<<endl;
finish=clock();
duration=(double)(finish-start)/CLOCKS_PER_SEC;
cout<<"Total Duration"<<duration<<endl;
return 0;
}//end of main
//////////////////////////////////////////////////////////////////////
//void CopyArray(int p[],int q[],int vec)//this is the function call.
//{
// int i;
// for(i=0;i<vSize;i++)
//p[i]=q[i];
//}