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
Is there a way to switch on strings?
What are the ways to a null pointer can use in c programming language?
Write a code of a general series where the next element is the sum of last k terms.
What Is The Difference Between Null And Void Pointer?
What library is sizeof in c?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
Can you please explain the difference between strcpy() and memcpy() function?
if p is a string contained in a string?
What is the value of uninitialized variable in c?
How many bytes is a struct in c?
Why do we use stdio h and conio h?
What the advantages of using Unions?
What are the types of data files?
What is pointers in c with example?
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