I am trying to to create structure "Date of birth", and function that will assign values to the structure, and i am wondering is that possible to do that somehow like this:
(PS. I am constantly getting error "Argument list syntax error", for 2nd and 23th lines.)
#include <stdio.h>
void input (dob_st *);
int main ()
{
typedef struct
{
int year;
int month;
int day;
}
dob_st;
dob_st date;
dob_st *p;
p=&date;
input (*p);
printf("%02i.",p->day);
printf("%02i.",p->month);
printf("%i.",p->year);
return 0;
}
void upis (dob_st *p)
{
printf ("Date of birth:\nDay?\n");
scanf ("%i",&(p->day));
printf ("Month?\n");
scanf ("%i",&(p->month));
printf ("Year?\n");
scanf ("%i",&(p->year));
}