POINTERS
Here is the code:
#include <stdio.h>
#define SIZE 7
void display_marks( float *, int);
int main()
{
float marks[SIZE] = {10, 11, 12, 13, 14, 15, 16};
display_marks(marks, SIZE);
}
void display_marks(float *p, int size)
{
int i;
for(i=0; i<SIZE; i++)
printf("%.2f\n", p[i]);
}
This is a working program, but i do not understand a few tasks..
a couple of questions i need to ask:
1. at void display_marks( float*, int)
what does float* do? how come it is intialise at float*, pointing to what?what does it mean?call to function , isnt it passing the value of float marks[SIZE] instead?
2. void (float *p, int size)
again, how come it is float*p now? pointing to what?
an last but not least how come, p[i] prints the value of the array
peat and repeat IM LOST, if you could help please explain in simple english. Thanks guys