> The program is not working as it should supposed to do
Code:
$ cat foo.c
#include<stdio.h>
void Fun (int content[], int n );
int main ()
{
int n = 6;
int array[6] = {6, 5, 4, 3, 2, 1};
Fun (array, n);
}
void Fun (int content[], int n )
{
for (int i = 0; i < n; i++)
{
printf(" % d ", content);
}
}
$ gcc foo.c
foo.c: In function ‘Fun’:
foo.c:18:11: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int *’ [-Wformat=]
printf(" % d ", content);
^
If you're not seeing warnings like this, then get a better compiler.
If you are seeing warnings like this, then pay attention to them.
If you don't understand a warning, then post the code and the warning.
Don't just run the code anyway and complain that it doesn't work.