void test()
{
int buf[1000];
//populate buf
foo(buf);//is this correct? Can we pass buf as a pointer that foo expects?
}
void foo(void*ptr)
{}
EDIT:
if foo were fwrite, would the above(mechanism of passing buf so as to supply fwrite with content to write into some file) still be applicable?
Its perfectly valid in C.
fooargument is a pointer that can point to any type. When you pass an array, it decays to a pointer pointing to the first element of the array (i.e.,address location of the first element is passed). So,