O.K. guys I know this structure is declared in main but I don't understand why I can't send it's pointer to another function I knoe the functions need to know about it before they can use it put I thought the prototype did that, after all if this was a pointer to an int or char it would be done like this so why not with structures.



#include<stdio.h>
#include<conio.h>

void details1(struct baby *kayleigh_ptr);

int main()
{

struct baby{
int age;
char name[10];
};


struct baby kayleigh;
struct baby *kayleigh_ptr=&kayleigh;


details1(kayleigh_ptr);
getch();

return 0;
}

void detail1(struct baby *kayleigh_ptr)
{
kayleigh_ptr->age=10;
}


thanks leaner(wanting to be a master).