Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- using namespace std;
- struct el_FIFO{
- int x;
- struct el_FIFO* nast;
- };
- struct FIFO
- {
- struct el_FIFO* poczatek;
- struct el_FIFO* koniec;
- };
- struct FIFO * attach(struct FIFO *k,int el)
- {
- struct el_FIFO * new_el= new struct el_FIFO;
- new_el-> x=el;
- new_el->nast=NULL;
- if(k -> poczatek==NULL)
- {
- k->poczatek=new_el;
- k->koniec=new_el;
- }
- else
- {
- k->koniec->nast=new_el;
- k->koniec=new_el;
- }
- return k;
- }
- /*struct el_FIFO* push(struct el_FIFO *top, int el){
- //dodanie elementu na stos
- // wartość elementu dodawanego jest w zmiennej el,
- //wskaźnik na wierzchołek stosu jest w zmiennej top
- //wynikiem funkcji jest wskaźnik na nowy wierzchołek stosu
- struct el_FIFO * new_el_FIFO=(struct el_FIFO*)malloc(sizeof(struct el_FIFO));
- new_el_FIFO->x=el;
- new_el_FIFO->nast=top;
- return new_el_FIFO;
- }*/
- int main()
- {
- }
Add Comment
Please, Sign In to add comment