Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

C program to perform stack operation using singly linked list

Answer Posted / bin fang

And much better and simpler implementation should be like
this:

void Push(int info)
{
node *temp;

temp = (node *)malloc(sizeof(node));
temp->data = info;
temp->next = head;
head = temp;
count++;
}

void Pop(void)
{
node *temp;

temp = head;
head = head->next;
free(temp);
count--;
}

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is a pointer a kind of array?

1178


When do we get logical errors?

1122


Explain the use of bit fieild.

1137


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

2187


What are the different properties of variable number of arguments?

1153


Should I learn data structures in c or python?

1016


What are void pointers in c?

995


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

3964


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2738


What is #pragma statements?

1095


Explain continue keyword in c

1017


Which one would you prefer - a macro or a function?

1076


What is the most efficient way to store flag values?

1181


What are control structures? What are the different types?

1086


Why functions are used in c?

1131