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
What are the advantage of c language?
What does calloc stand for?
i have a written test for microland please give me test pattern
What is a static function in c?
Write a program that accept anumber in words
What is array of structure in c programming?
What are the key features in c programming language?
Process by which one bit pattern in to another by bit wise operation is?
Why void main is used in c?
How are 16- and 32-bit numbers stored?
Can we change the value of #define in c?
What is the difference between far and near ?
can anyone suggest some site name..where i can get some good data structure puzzles???
Do character constants represent numerical values?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?