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

What are the advantage of c language?

1054


What does calloc stand for?

1167


i have a written test for microland please give me test pattern

2734


What is a static function in c?

1170


Write a program that accept anumber in words

1761


What is array of structure in c programming?

1291


What are the key features in c programming language?

1076


Process by which one bit pattern in to another by bit wise operation is?

1168


Why void main is used in c?

1051


How are 16- and 32-bit numbers stored?

1293


Can we change the value of #define in c?

1001


What is the difference between far and near ?

1197


can anyone suggest some site name..where i can get some good data structure puzzles???

2085


Do character constants represent numerical values?

1347


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

1096