'function_name': Identifier not found

0
void inserePoli1(poli **topo1, int val, int expo) {
    polinomio1 *novo;
    char cmd;
    novo = new poli;
    novo->valor = val;
    novo->expoente = expo;
    if (*topo1 == NULL) {
        novo->prox = NULL;
        *topo1 = novo;
    }
    else {
        novo->prox = *topo1;
        *topo1 = novo;
    }
    cout << "Deseja inserir mais um elemento? (sim - S/não - N)" << endl;
    cin >> cmd;
    if (cmd == 's') {
        criaPoli1(val, expo, *topo1);
     }
}

void criaPoli1(int &val, int &expo, poli *topo1) {
    cout << "\nInsira o VALOR: ";
    cin >> val;
     cout << "Insira o EXPOENTE: ";
    cin >> expo;
    inserePoli1(&topo1, val, expo);
}

Taking into account that below these two functions my main() already has the call to criapoli1 , how can I call this same function, being that placing cryapoli1 above inserepoli1 results in error and vice versa also returns error since one calls the other ...

    
asked by anonymous 17.09.2018 / 19:15

1 answer

0

Put the statement and leave the definition for later:

void criaPoli1(int &val, int &expo, poli *topo1);

You can even do:

void criaPoli1(int &, int &, poli *);
    
17.09.2018 / 19:22