OK so I have this struct:
Code:
struct person{
char first[30];
char last[30];
char month[11];
int day;
int year;
int num_month;
int total_days;
};
I need to transfer all of the data into a temp struct. I originally tried using:
Code:
temp[mc] = people[count1];
This worked on my home computer and the people were correctly sorted but when I tried it on one at school it crashed.
My next thought was to break it down and store each member individually like:
Code:
temp[mc].first = people[count1].first;
temp[mc].last = people[count1].last;
temp[mc].month = people[count1].month;
temp[mc].day = people[count1].day;
temp[mc].year = people[count1].year;
temp[mc].num_month = people[count1].num_month;
temp[mc].total_days = people[count1].total_days;
And this works for the integers, but I'm getting incompatible types for the three char array members (first, last, month).
I don't really know the correct way to do this so can anyone help me out? Thanks in advance.