使用函数实现两个数的交换

#include #include void swop(int* a, int* b) { int tmp; tmp = *a; *a = *b; *b = tmp; } int main() { int x = 10; int y = 20; swop(&x, &y); printf("x=%d y=%d", x, y); system("pause"); return 0; }

    推荐阅读