am having these error:
/home/Desktop/L3Q3.c: In function ‘inputStudent’:
/home/Desktop/L3Q3.c:23:2: warning: format ‘%d’ expects type ‘int *’, but argument 2 has type ‘int’
/home/Desktop/L3Q3.c: At top level:
/home/Desktop/L3Q3.c:27:27: error: expected ‘)’ before ‘std’
Help please?
#include<stdio.h>
typedef struct student
{
char surname[20];
char oname[20];
char address[20];
int age;
}stud;
void inputStudent(stud std)
{
printf("Enter student surname: \n");
scanf("%s",std.surname);
printf("Enter student other names: \n");
scanf("%s",std.oname);
printf("Enter address: \n");
scanf("%s",std.address);
printf("Enter age:\n");
scanf("%d",std.age);
}
void displayStudent(Stud std)
{
printf("Surname:%s\n",std.surname);
printf("Other Name:%s\n",std.oname);
printf("Address:%s\n",std.address);
printf("Age: %d \n",std.age);
}
void main()
{
stud S1;
inputStudent(S1);
displayStudent(S1);
}