have `struct_gene` and `struct_units`.
i read all `Struck_gene` values to `vector`.
How do i assign pointer for `struck_units.has_gene[i]` to point to some value in `struct_gene`vector so i dont have to write full copy of stuckt\_gene
And after that read it.

I tried for some time but didn't manage to get working solution

<http://a.imageshack.us/img195/8607/001tfa.jpg>

Edit - Here's the code as retrieved by Jakobud:

```
#include <iostream>
#include <fstream>
#include <vector>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>

using namespace std;
struct struct_gene {
    string name;
    string description;
};

struct struct_unit {
    string name;
    string surname;
    int age;
    int hunger;
    int happines;
    vector<struct_gene> *has_genes[12];
    struct_unit *maried_to;
    struct_unit *father;
    struct_unit *mother;
};

int main () {
    const int default_unit_count = 4;
    fstream gene_list;
    struct_gene * t_struct_gene;
    t_struct_gene = new struct_gene;
    gene_list.open("gene_list", ios::in);
    vector<struct_gene> vector_gene;
    //string name, description;

    gene_list >> t_struct_gene->name;
    getline(gene_list, t_struct_gene->description);
    while (gene_list) {
        vector_gene.push_back(*t_struct_gene);
        gene_list >> t_struct_gene->name;
        getline(gene_list, t_struct_gene->description);
    }
    delete t_struct_gene;

//   for (int i =0; i<vector_gene.size(); i++) {
//      cout <<vector_gene[i].name <<" "<<vector_gene[i].description<<endl;
//   }
    struct_unit *t_struct_unit;
    t_struct_unit = new struct_unit;

    srand ( time(NULL) );

    vector<struct_unit> vector_units;

    for (int i=0; i<default_unit_count; i++) {

        t_struct_unit->name = "unit_name";
        t_struct_unit->surname = "unit_surname";
        t_struct_unit->age = rand()%200;
        t_struct_unit->hunger = rand()%70 +30;
        t_struct_unit->happines = rand()%70 + 30;
        for (int i=0; i<12; i++) {
            t_struct_unit->has_genes[i] = vector_gene[rand()%vector_gene.size()];
        }
        t_struct_unit->maried_to = NULL;
        t_struct_unit->father = NULL;
        t_struct_unit->mother = NULL;
        vector_units.push_back(*t_struct_unit);
    }

    for (int i=0; i<vector_units.size(); i++) {
        cout << vector_units[i].name <<" "<<vector_units[i].surname<<endl;
        cout <<"Age:"<< vector_units[i].age <<" Hunger:"<<vector_units[i].hunger<<" Happines:"<<vector_units[i].happines<<endl;
        for (int j=0; j<0; j++) {
            cout <<vector_units[i].has_genes[j].name;
        }
        cout <<"==="<<endl;
    }
    delete t_struct_unit;
}

```