Malloc #4162
                  
                    
                      Savitashri
                    
                  
                
                  started this conversation in
                General
              
            
            
              Malloc
            
            #4162
          
          
        Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
void main()
{
struct node
{
int data;
struct nodenext;
};
struct nodehead,*new node,temp;
head=0;int choice;
while(choice)
{
newnode=(struct node)malloc(sizeof(struct node));
printf("enter data");
scanf("%d",&newdata->data);
newdata->next=0;
if(head==0)
{
Head=temp=newnode;
}
else
{
temp->next=newnode;
temp=newnode;
}
printf(would you want to continue(0,1));
scanf("%d",&choice);
}
temp=head;
while(temp!=0)
{
scanf("%d",temp->data);
temp->temp=next;
}
getch();
}
Beta Was this translation helpful? Give feedback.
All reactions