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

Why can't I perform arithmetic on a void* pointer?

1152


Explain the use of 'auto' keyword

1171


Explain about block scope in c?

1140


Can you please explain the difference between syntax vs logical error?

1238


The __________ attribute is used to announce variables based on definitions of columns in a table?

1251


What is the difference between volatile and const volatile?

1043


What does sizeof function do?

1254


What is the hardest programming language?

1210


Explain the use of function toupper() with and example code?

1167


How can you find out how much memory is available?

1112


What is structure pointer in c?

1089


Write a program to show the change in position of a cursor using c

1122


How is a pointer variable declared?

1156


When we use void main and int main?

1125


What would happen to X in this expression: X += 15; (assuming the value of X is 5)

2018