指针交换ab的值

#include
void f(int *x, int *y)
{
    int t;
    t = *x;*x = *y;*y = t;
}
int main()
{
    int a = 8, b = 3;int* x, * y;
    x = &a;y = &b;
    f(x, y);
    printf("%d %d", a, b);
    return 0;
}     

你可能感兴趣的:(蓝桥杯,p2p,gnu)