在VS2017编码出现问题,有用过VS2015以上的哥哥姐姐们帮忙看下吗?谢谢
int main(){
int i, j, r, arr[MAX], index, data;
ptr_Node head, node;
node = (ptr_Node)malloc(sizeof(Node));
printf("输入数据(输入非数字停止)\n");
for (i = 0, j = 1; i < MAX&&j == 1; i++) //输入数据于数组
{
j = scanf("%d", &arr[i]);
}
while ((r = getchar()) && r != '\n');
head = create(arr, i - 1);
printf("输入数组如下(按三角形,从左到右输出):\n");
print(head);
sort(&head);
printf("排序后(按三角形,从左到右输出):\n");
print(head);
while (i!= 0) //可连续进行操作
{
printf("Choose operation:1)Destroy All 2)Insert 3)Delete one 4)Seek 5)Modification 6)exit Choose:");
scanf("%d", &j);
while ((r = getchar()) && r != '\n');
switch (j)
{
case 1:destroy(head); break;
case 2:printf("写下插入数据及插入哪一位点之后:(空格分开数据)");
scanf("%d%d", &node->data, &index);
node->next = NULL;
insert(&head, node, index);
node = (ptr_Node)malloc(sizeof(Node)); break;
case 3:printf("删除结点:");
scanf("%d", &index); Delete(&head, index, &data); break;
case 4:printf("查找数据:");
scanf("%d", &data);
while ((r = getchar()) && r != '\n');
printf("该节点为%d\n", search(head, data)); break;
case 5:printf("写下修改结点前一节点及修改数据:(空格分开数据)");
scanf("%d%d", &index, &data);
while ((r = getchar()) && r != '\n');
edit(head, index, &data); break;
case 6:i = 0;
}
} //此处以上全部可以执行,但往下代码不再执行,直接退出了程序,是VS2017的问题还是什么,我看不出来
printf("在此处程序未进行,直接退出程序,找不出原因");
free(node);
return 0;
}