Join Examsbook
747 0

Q: Improve the following code using typedef. struct node {       int data1;  float data2;        struct node *left;        struct node *right; }; struct node *ptr; ptr = (struct node *) malloc (sizeof (struct node) );

  • Show AnswerHide Answer
  • Workspace

Answer :
Explanation :

typedef struct node * treeptr typedef struct node {          int data1;          float data2;          treeptr *left;          treeptr *right; }treenode; treeptr ptr; ptr = ( treeptr ) malloc ( sizeof ( treenode ) );

Are you sure

  Report Error

Please Enter Message
Error Reported Successfully