Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <assert.h>
- #include <iostream>
- #include <vector>
- #include "push.h"
- using namespace std;
- void
- init(container_t *sptr)
- {
- }
- void
- container_insert(container_t *sptr,
- char c)
- {
- assert(sptr != NULL && "NULL pointer exception");
- container_t *newNode = sptr;
- newNode->container.push_back(c);
- }
- void
- container_printlist(container_t *sptr)
- {
- vector<char>::iterator itr;
- container_t *cur = sptr;
- for(itr = cur->container.begin(); itr != cur->container.end(); itr++)
- cout << *itr << ' ';
- cout << '\n';
- }
- char
- container_all_delete(container_t *sptr)
- {
- container_t *cur = sptr;
- cur->container.erase(cur->container.begin(), cur->container.end());
- if(cur->container.empty())
- printf("Is empty\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement