Confusing piece of code... Xcode compiler complains 'No matching function for call to 'init_population' yet another portion of similar code for another function works fine??? Any ideas please.

void init_population(int**,ga_vector &,ga_vector &);

void init_population(int** donut_population, ga_vector &population, ga_vector &buffer ) 
    int tsize = GA_TARGET.size();
    int double_digit = 0;

    CRobot **robot_pointer;
    robot_pointer = new CRobot *[4];


int donut_world_main(void)
    CRobot** donut_population;
    donut_population = new CRobot*[size];

    ga_vector pop_alpha, pop_beta;
    ga_vector *population, *buffer;

    init_population(donut_population, pop_alpha, pop_beta) // THIS IS THE PROBLEM LINE??
    population = &pop_alpha;

    buffer = &pop_beta;
4 Years
Discussion Span
Last Post by i-teq

Exhibit A: CRobot** donut_population;
Exhibit B: init_population(donut_population, pop_alpha, pop_beta)
Exhibit C: void init_population(int** donut_population

The donut_population you pass is CRobot**, but init_population() expects int**.


Thank you. What was confusing was that I had...

void setup_donut_world(int**,int,int,int,int);

static void setup_donut_world(CTopography** donut_world,int donut_world_size,int donut_world_dimension,int acid_pools,int energy_pills)

elsewhere and INT had been accepted. I've since changed this bit of code to CTopography and removed static. This makes it work consistently.

Honestly, that was a big help. Thanks.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.