Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void transfer(){
- typedef struct node{
- int data;
- node *next;
- }*nodeptr;
- nodeptr arrayNodes[5], listP, temp;
- for(int i = 0; i < 5; i++){
- arrayNodes[i] = new node;
- arrayNodes[i]->data = i - 1;
- }
- for(int i = 0; i < 5; i++){
- arrayNodes[i]->next = arrayNodes[i + 1];
- }
- arrayNodes[4]->next = 0;
- temp = arrayNodes[0];
- int st[4], top = 0;
- while(temp != 0){
- if(top == 4) cout<<"\nOver Flow\n";
- else
- st[top] = temp->data;
- temp = temp->next;
- }
- }
Add Comment
Please, Sign In to add comment