所以我的教授给了我们一些代码,他说它应该能够编译,但我得到各种错误,不知道什么是错的,因为我对c没有任何经验.它是一个汇编语言类,我们应该编写汇编代码来匹配c代码正在做的事情.他告诉我们在c中运行程序以了解事物.
#include <stdio.h>
#define SIZE 40
main()
{
int v[SIZE];
register int gap, i, j, temp;
/* Initialize array to random positive integers mod 256 */
for (i = 0; i < SIZE; i++)
v[i] = rand() & 0xFF;
/* Display the unsorted array */
for (i = 0; i < SIZE; i++)
printf(“v[%-d] = %-d\n”, i, v[i]);
/* Sort the array using a shell sort */
for (gap = SIZE / 2; gap > 0; gap /= 2) { …Run Code Online (Sandbox Code Playgroud)