You cannot declare function prototypes inside the body of a function. Move these lines above the definition of
main
:
struct point scan(struct point *p);
void print(struct point *p);
And do yourself a favour, and don't use single character names: use "proper" names and your code becomes a lot easier to read.
#include<stdio.h>
struct point
{
int x;
int y;
} myPoint;
struct point scan(struct point *p);
void print(struct point *p);
int main()
{
scan(&myPoint);
print(&myPoint);
return 0;
}
struct point scan(struct point *p)
{
scanf("%d%d",p->x,p->y);
}
void print(struct point *p)
{
printf("%d%d",p->x,p->y);
}