I cut the variables down to one but now the program won't compile at all:
Code:
#include<iostream>
using namespace std;
#define MAX_LIST_LEN 2000
int main(){
int n, // list length
j,
L, // loop control
a[MAX_LIST_LEN]; // array to be sorted
int count = 0;
for (L = 2){
while (L <= n)
j = L;
while (j>=2
)a[j]<a[j-1];
a [j] == a[j-1];
j = j-1;
while (L>=1&&++count&&a[j]<a[j-1]
)cout << count << " ";
return(0);
}
}
When I try to compile I receive these errors:
Code:
InsertionSort.cpp:22: error: expected `;' before â)â token
InsertionSort.cpp:34: error: expected primary-expression before â}â token
InsertionSort.cpp:34: error: expected `;' before â}â token
InsertionSort.cpp:34: error: expected primary-expression before â}â token
InsertionSort.cpp:34: error: expected `)' before â}â token
InsertionSort.cpp:34: error: expected primary-expression before â}â token
InsertionSort.cpp:34: error: expected `;' before â}â token