I hope this works for ya:
Code:
#include <stdio.h>
#include <stdlib.h>
/// STRUCTURES
struct Sbirth {
double Birth_year;
double Birth_month;
double Birth_day;
};
struct Sstuff {
char street[50];
char city[50];
char state[15];
char zip[10];
};
struct personal {
char F_name[50];
char L_name[50];
double salary;
struct Sbirth birth;
struct Sstuff stuff;
};
/// PROTOTYPE FUNCTIONS
struct personal create_new();
/// MAIN
int main() {
struct personal p = create_new();
printf("Hello %s", p.F_name);
return 0;
}
/// CREATE NEW PERSON
struct personal create_new() {
struct personal temp;
printf("\nFist Name: ");
fgets(temp.F_name, sizeof temp.F_name, stdin);
printf("\nLast Name: ");
fgets(temp.L_name, sizeof temp.L_name, stdin);
printf("\nSalary: ");
scanf("%d", &temp.salary);
printf("\nMonth of birth: ");
scanf("%d", &temp.birth.Birth_month);
printf("\nDay of Birth: ");
scanf("%d", &temp.birth.Birth_day);
printf("\nYear of Birth: ");
scanf("%d", &temp.birth.Birth_year);
printf("\nAddress information...");
printf("\nStreet name: ");
fgets(temp.stuff.street, sizeof temp.stuff.street, stdin);
printf("\nCity: ");
fgets(temp.stuff.city, sizeof temp.stuff.city, stdin);
printf("\nState: ");
fgets(temp.stuff.state, sizeof temp.stuff.state, stdin);
printf("\nZip Code: ");
fgets(temp.stuff.zip, sizeof temp.stuff.zip, stdin);
return (temp);
}