更新了文件名。开始了数据结构

This commit is contained in:
lzy
2024-04-14 06:55:53 +08:00
parent 9bc7edbf47
commit 45bcb90c6d
69 changed files with 455 additions and 0 deletions

44
Chapter07/swap.c Normal file
View File

@@ -0,0 +1,44 @@
#include <stdio.h>
#include <stdlib.h>
#if 0
int print_value(int a, int b)
{
printf("%d %d\n", a, b);
return 0;
}
#endif
// void swap(int i, int j)
// {
// int tmp;
// tmp = i;
// i = j;
// j = tmp;
// }
void swap(int *p, int *q)
{
int tmp;
tmp = *p;
*p = *q;
*q = tmp;
}
int main()
{
int i = 3, j = 5;
// swap(i, j);
// 实际没有交换
swap(&i, &j);
printf("%d %d\n", i, j);
// print_value(i, j);
exit(0);
}