

这个情况就很难受,编译没错,但是运行出现问题了,如果点击中止(重试、忽略)下一次运行还是会出现,看了显示的大致意思是在数组arry上出现了什么错误,经过检查发现,原来是数组在数入时,它的长度出现了问题,等于了MIN。将等于号取出后就无错了。
 
以下为代码:(修改后)
#include <stdio.h>
#include <stdlib.h>  //typedef unsigned char uchar 存在函数定义
#define MIN 10
#define ROWS  3
#define COLS  3
void InitElemtpy(int* arry);
void OutElempty(int* arry);
int main()
{
	int arry[MIN];
	InitElemtpy(&arry[0]);
	OutElempty(&arry[0]);
	return 0;
}
void InitElemtpy(int* arry)
{
	int i = 0;
	printf("Input Data\n");
	do
	{
		scanf_s("%d", &arry[i]);
		i++;
	} while ((arry[i - 1] >= 0) && ((i - 1) < MIN));
	i--;
	if (i < MIN - 1)
	{
		for (; i <MIN; i++)
		{
			arry[i] = 0;
		}
			
	}
}
void OutElempty(int* arry)
{
	printf("Output Elemtype\n");
	for (int i = 0; i < MIN; i++)
	{
		printf("%d\t", arry[i]);
	}
} 
(仅个人学习中遇到的错误,若有更好的修改方法,或不足,感谢评论或私信指正)


















