Advertisement
Aminpro

[ECP1026]Tutorial 4 Question 1

Nov 28th, 2012
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. //https://www.facebook.com/AminproPastebin
  2.  
  3. (i)
  4. 1. Illegal, var can;t store a pointer.
  5. 2. Legal
  6. 3. Legal, both have the same type of carible (pointer).
  7. 4. Illegal, You can only free memmory location that is type of pointer.
  8.  
  9. (ii)
  10. struct Node * createNode(char c){
  11. temp = (struct node*)malloc(sizeof(struct node));
  12. struct Node *temp;
  13. temp->c=c;
  14. temp ptr=NULL;
  15. return (temp);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement