daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void transfer(){
  2.     typedef struct node{
  3.         int data;
  4.         node *next;
  5.     }*nodeptr;
  6.     nodeptr arrayNodes[5], listP, temp;
  7.     for(int i = 0; i < 5; i++){
  8.         arrayNodes[i] = new node;
  9.         arrayNodes[i]->data = i - 1;
  10.     }
  11.     for(int i = 0; i < 5; i++){
  12.         arrayNodes[i]->next = arrayNodes[i + 1];
  13.     }
  14.     arrayNodes[4]->next = 0;
  15.     temp = arrayNodes[0];
  16.     int st[4], top = 0;
  17.     while(temp != 0){
  18.         if(top == 4) cout<<"\nOver Flow\n";
  19.         else
  20.             st[top] = temp->data;
  21.         temp = temp->next;
  22.     }
  23.  
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top