This commit is contained in:
Jdhggg 2025-03-17 14:33:15 +08:00
parent 37722e30cb
commit 2f811acca9
6 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,4 @@
 main.c
sq_list.c
正在生成代码...
C:\code\lencode\Project2\main.c(9,34): warning C4047: “函数”:“sq_list *”与“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

6
main.c
View File

@ -6,8 +6,10 @@
int main(void)
{
sq_list list;
init_sq_list(&list);
sq_list *list = init_sq_list(&list);
list->length = 6;
replace_sq_list(list, 2, 5);
print_sq_list(list);
printf("Hello World!\n");
return 0;
}

View File

@ -7,7 +7,6 @@ sq_list* init_sq_list(sq_list *name)
{
name = (sq_list*)malloc(sizeof(sq_list));
memset(name, 0, sizeof(sq_list));
return name;
}
// 删除
@ -53,7 +52,7 @@ void insert_sq_list(sq_list* list, int pos, int value)
}
if (pos == MAX)
printf("有损插入\n");
if 9pos > list->length && pos <= MAX)
if (pos > list->length && pos <= MAX)
printf("不建议在此处插入");
int i = list->length;
int flog = i;