//Swap///
void Swap(int *a, int *b)
{
int tmp;
tmp = *a;
*a = *b;
*b = tmp;
}
void Swap1(int *a, int *b)
{
*a = *a^*b;
*b = *a^*b;
*a = *a^*b;
}
int main(const int argc, const char *argv[])
{
int a = 6, b = 0;
printf("a=%d, b=%d\n", a, b);
Swap1(&a, &b);
printf("a=%d, b=%d\n", a, b);
system("pause");
return 0;
}
数据结构_交换数据
最新推荐文章于 2022-11-07 11:36:48 发布