I am trying to create a program with a structure that stores the information of a student. It must also include a function that prompts the user for the information of the student. The functions only argument is to be pointer to the structure. I am completly lost, (as I think my code shows). Can someone please tell where I've screwed up at? My compiler won't even compile this( I'm using Borland 5). I've never had that happen before.
Code:
#include<stdio.h>
#include<stdlib.h>
typedef struct
{
char firstname[25];
char lastname[25];
}name_struct;
typedef struct
{
name_struct name;
char ssn[10];
char phone[10];
int quiz[5];
}student;
void get_student_details(student*);
main()
{
student student;
get_student_details(&student);
printf("\n\nThe student's name is: %s %s", student.firstname, student.lastname);
}
void get_student_details(student* student_details)
{
printf("\nEnter the first name of the student:");
scanf("%s", student_details->firstname);
printf("\nEnter the last name of the student:");
scanf("%s", student_details->lastname);
printf("\nEnter the social security number:");
scanf("%s", student_details->ssn);
printf("\nEnter the student's phone number:");
scanf("%s", student_details->phone);
printf("\nEnter the student's 5 quiz grades:");
for(number=0; number<5; ++number)
{
printf("\nEnter the grade for %d:", quiz+1);
scanf("%lf", student_details->quiz);
}
}