Thread: How to stratify a population?

1. How to stratify a population?

Hello there,
I am new to this board. Let me introduce myself, I'm Matt, 21yo, beginner in C, french.
I got a problem here.
I do not know how to stratify a population. By that I mean I want to do the following (examples):

Code:
```individual[1] = {18, 2, 1600, 3, TRUE}
individual[2] = {7, 1, 1700, 2, FALSE}
individual[3] = {41, 2, 1800, 2, FALSE}
individual[4] = {72, 1, 1500, 1, TRUE}
```

On a total of 100 individuals, so I guess individual[100] would be the population's amount.
But I would like to set settings for each individual in this population. So that I can make individuals into categories.
The values I showed stand for (age, job, salary, religion, bool isInASyndicate)
Then I could obtain the number of syndicated people, adult people, children people, muslim and christian people etc. into variables like
int numberOfFactoryWorkers
int numberOfMuslims
int numberOfSeniors
Etc.
int populationTotal...

Thank you very much for helping me!

2. I'm not sure what exactly you are asking because your question is too general.

But for a start, if you haven't done this already.... You probably need to declare a struct where you store your values

Code:
```typedef struct{

int age;
int job;
int salary;
int religion;
bool isInASyndicate;

}individual;```
Put the struct into use in storing your data:

Code:
`individual individuals[100];`
Possibly zero initialize all your structs then populate possibly from user input etc

So, what exactly are you having a problem doing? Where have you got?