纠错
sq插入函数位置不对
This commit is contained in:
parent
60b1d8e65a
commit
2d99fe1c7e
@ -1,4 +1,3 @@
|
|||||||
main.c
|
sq_list.c
|
||||||
C:\code\lencode\Project2\main.c(9,34): warning C4047: “函数”:“sq_list *”与“sq_list **”的间接级别不同
|
C:\code\lencode\Project2\sq_list.c(10,1): warning C4716: “init_sq_list”: 必须返回一个值
|
||||||
C:\code\lencode\Project2\main.c(9,34): warning C4024: “init_sq_list”: 形参和实参 1 的类型不同
|
|
||||||
Project2.vcxproj -> C:\code\lencode\Project2\Debug\Project2.exe
|
Project2.vcxproj -> C:\code\lencode\Project2\Debug\Project2.exe
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -54,9 +54,9 @@ void insert_sq_list(sq_list* list, int pos, int value)
|
|||||||
printf("有损插入\n");
|
printf("有损插入\n");
|
||||||
if (pos > list->length && pos <= MAX)
|
if (pos > list->length && pos <= MAX)
|
||||||
printf("不建议在此处插入");
|
printf("不建议在此处插入");
|
||||||
int i = list->length;
|
int i = list->length -1;
|
||||||
int flog = i;
|
int flog = i;
|
||||||
for (i; i > pos; i--)
|
for (i; i >= pos-1; i--)
|
||||||
{
|
{
|
||||||
list->data[i + 1] = list->data[i];
|
list->data[i + 1] = list->data[i];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user