I have been looking this over for way to long now. I know that the problem must be simple, but I just don't see it. I am getting two big warnings that I know need to be addressed before the program will actually work, but I am to new to recognize the issue. The warnings are
c:8: warning: assignment makes integer from pointer without a cast
c:10: warning: passing arg 1 of `display' makes pointer from integer without a cast
and of course the code is
Code:
#include <stdio.h>
int display (int*);
int main()
{
int channel[7];
int *cptr;
channel[7]="2,4,5,7,9,11,13";
cptr = channel;
display (*cptr);
return 0;
}
int display (int *cptr)
{
int i;
for (i=0; i<=6; ++i)
printf ("\nElement %d is %d", i,*(cptr + i));
system ("Pause");
return 0;
}
Any help, no matter how critical is appreciated. Please give me a small explination with it so I don't have this again in the future. Thanks.