#include
typedef int KeyType;
typedef struct
{
KeyType key;
}DataTape;
void InsertSort(DataType a[],int n)
{
int i,j;
DataType temp;
for(i = 0; i-1 && temp.key < a[j].key)
{
a[j+1] = a[j];
j--;
}
a[j+1] = temp;
}
}
void main(void)
{
DataType test[6] = {64,5,7,89,6,24};
int i,n = 6;
InsertSort(test,n);
for(i=0; i<n; i++)
printf("%d ",test.key);
}
编译室提示这个程序的
void InsertSort(DataType a[],int n)
变量列表语法错误,我自学C++,没什么基础,请教大家,这到底是怎么一回事,还有,希望能给我一些学C的建议,在此谢过。
|