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 putting creation1 above inserepoli1
results in error and vice versa also returns error once one calls the other...
Could exemplify using my own code?
– Guilherme Melo
I could if I had put it correctly, but without even giving to understand what it has in it gets a little more complicated.
– Maniero
after I clicked on the link I understood what I needed to do, thank you very much!!
– Guilherme Melo