Hello everybody from Italy!!! Initially in my 'Union - Find' that I have implemented I've defined these 4 structures, respectively: 'A - a', 'B - b', 'C - c', 'D - d', but I want to do it directly with the Constructor, but my program, when I debug it, visualize the 'iostream' header file library and then ends with the usual warning : "segmentation fault!".
Here is my Constructor :
Code:
public :
Lista* nodoA, *nodoB, *nodoC, *nodoD;
Union() { nodoA->name = 'A'; nodoA->nxt = NULL; nodoB->name = 'B'; nodoB->nxt = NULL; nodoC->name = 'C'; nodoC->nxt = NULL; nodoD->name = 'D'; nodoD->nxt = NULL; } /* Constructor. */
~Union() { delete nodoA; delete nodoB; delete nodoC; delete nodoD; } /* Destructor. */
Where do I wrong? :'( Is it legal?? I hope in your help!