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 there a way to switch on strings?

1027


What are the ways to a null pointer can use in c programming language?

1074


Write a code of a general series where the next element is the sum of last k terms.

985


What Is The Difference Between Null And Void Pointer?

1155


What library is sizeof in c?

1033


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2016


Can you please explain the difference between strcpy() and memcpy() function?

1013


if p is a string contained in a string?

1792


What is the value of uninitialized variable in c?

975


How many bytes is a struct in c?

1104


Why do we use stdio h and conio h?

1030


What the advantages of using Unions?

1161


What are the types of data files?

1144


What is pointers in c with example?

1018


If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above

994