#include <stdio.h> #include <stdlib.h> void switchs(int *,int *); int main(int argc, char *argv[]) { int a = 10, b = 20; switchs(&a,&b); printf("a = %d, b = %d",a,b); return 0; } void switchs(int *psA, int *psB){ int sw = *psA; *psA = *psB; *psB=sw; }
沒有留言:
張貼留言