Ahoj, mám jednoduchou funkci na otáční čísel. Ale kompilátor trochu řve. Můžete mi prosím někdo poradit, co je na ukazatelích špatně?
main.c:25:3: warning: passing argument 1 of ‘swap’ makes pointer from integer without a cast [enabled by default]
main.c:15:6: note: expected ‘int *’ but argument is of type ‘int’
main.c:25:3: warning: passing argument 2 of ‘swap’ makes pointer from integer without a cast [enabled by default]
main.c:15:6: note: expected ‘int *’ but argument is of type ‘int’
main.c:26:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int *’ [-Wformat]
main.c:26:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘int *’ [-Wformat]
void swap (int *a, int *b)
{
int c = *a;
*a = *b;
*b = c;
}int main (void)
{
int a = 3, b = 2;
swap(a, b);
printf("%d, %d\n", &a, &b);
return 0;
}