Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "list.h"
- template <class T> List<T>::List() {
- this->next = NULL;
- }
- template <class T> List<T>::List(List *next) {
- this->next = next;
- }
- template <class T> void List<T>::add(T element) {
- if(element*!=NULL) {
- List *newList = new List;
- element = List;
- } else {
- List *newList = new List;
- newList->next = NULL;
- }
- }
- template <class T> void List<T>::show() {
- while(List->next != NULL) {
- cout << &List << endl;
- }
- }
- template <class T> bool List<T>::is_empty() {
- if(this->List == NULL) {
- cout << "Lista jest pusta." << endl;
- return true;
- } else {
- cout << "Lista nie jest pusta." << endl;
- return false;
- }
- }
- template <class T> T List<T>::get(int i) {
- for(int j = 0; j <= i; j++){
- List = List->next;
- }
- cout << &List << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement