Hmm, is there any particular reason you can't use the standard C++ stack template? I'm pretty sure it would save you a lot of trouble. Just include the 'stack' header. Check a reference for usage,...
Type: Posts; User: Michael Bell
Hmm, is there any particular reason you can't use the standard C++ stack template? I'm pretty sure it would save you a lot of trouble. Just include the 'stack' header. Check a reference for usage,...
You need to allocate some memory for the char* in the node before trying to read into it:
x->v = new char[80];
cout << "Enter your name: ";
cin.getline(x->v, 80);
An alternative would be to...