C++ Please update code: Please change code so that it is usingthe <list> class instead.
Source Code:
#include <iostream>
using namespace std;
struct Item { // declare variables
Item *previous; // pointer
char aChar;
Item *next; // link
};
void push(Item **top, string str, int a) { // pushing ontostack
int i;
char aChar;
for (i = 0; i < a; i++) {
aChar = str[i]; // setting char var to aposition in the string
Item *new_top = new Item;
new_top->aChar = aChar;
new_top->previous = 0;
new_top->next = (*top);
(*top)->previous = new_top;
(*top) = new_top;
}
}
void printL(const Item *h, int a) { // prints the reversedlist
int i = 0;
for (const Item *p = h; i < a; p = p->next){
cout <<
PayPal Gateway not configured
PayPal Gateway not configured