diff --git a/8.md b/8.md new file mode 100644 index 0000000..45a6711 --- /dev/null +++ b/8.md @@ -0,0 +1,16 @@ +// 8交换两个长整型数据 +void SwapLong(long *x, long *y) +{ +long temp; +temp = *x; +*x = *y; +*y = temp; +} +// 交换两个字符串 +void SwapChar(char x[], char y[]) +{ +char temp[MAX_LEN]; +strcpy(temp, x); +strcpy(x, y); +strcpy(y, temp); +}