Code:
how come when I code it this way it only loops to the 2nd value in the array?
#include< iostream >
#include< iomanip >
#include< cstdlib >
#include< ctime >
#include< cstdio >
#include< fstream >
const int vSize = 2;
using namespace std;
int main()
{
int vec[vSize]={500,200};//,50000//,100000,200000,400000};
//Declare the clock variables
clock_t start,finish;
clock_t startAll;
//Declare and initialize all the variables
double duration;
//Declare the streams and the input and output files
ifstream inFile;
ofstream outFile;
inFile.open("input1.txt");
outFile.open("A:/output1.txt");
int Sum=0;
//Test the algorithms
start=clock();
outFile<<"Numbers to be sorted"<< endl;
for(int i =0; i < vec[vSize-1] ; i++)
{
Sum++;
outFile<< Sum<<endl;
}
//Switch statement to start the different sort algorithms
finish=clock();
duration=(double)(finish-start)/CLOCKS_PER_SEC;
cout<<" "<< setw(4)<< duration;
finish=clock();
duration=(double)(finish-start)/CLOCKS_PER_SEC;
cout<<"Total Duration"<< duration<< endl;
return 0;
}//end of main