我在 Mac OS 10.7 上使用 Xcode 4.1
#include <stdio.h>
int main (int argc, const char * argv[])
{
int i, j;
i = 1;
j = 9;
printf("i = %d and j = %d\n", i, j);
swap(&i, &j);
printf("\nnow i = %d and j = %d\n", i, j);
return 0;
}
swap(i, j)
int *i, *j;
{
int temp = *i;
*i = *j;
*j = temp;
}
我收到警告“函数“交换”的隐式声明在 C99 中无效