Allora ho una struttura che supponiamo si chiami STRUTT e la assegno così
codice:
int main()
{
STRUTT **miaVar = NULL;
int N = 0;
funzioneEsterna(&miaStrutt, &N);
miaStrutt[0]->campo1 = "xyz";
miaStrutt[0]->campo2 = "123";
}
int funzioneEsterna(STRUTT ***Elem, int *N)
{
allocaMemoria(Elem, N);
}
Così funziona tutto correttamente, quello che vorrei è che le due righe:
codice:
miaStrutt[0]->campo1 = "xyz";
miaStrutt[0]->campo2 = "123";
possano essere scritte tramite la funzione funzioneEsterna() e non nel main, come posso fare? Tutti i miei tentativi mi danno errore.
Grazie è importante!