How a new element can be added or pushed in a stack?
Answer / Vipin Gautam
A new element can be added to a stack using the push() function in STL (Standard Template Library). This function appends an element onto the top of the stack, increasing its size by 1. Example: n```n#include <stack>nstack<int> s; // creating a stack of integersns.push(5); // adding the number 5 to the stackn```
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the basics of classifying different storage types, why?
2 Answers Astergate, Symphony,
What is virtual destructor ans explain its use?
When can I use a forward declaration?
Which bitwise operator is used to check whether a particular bit is on or off?
Explain the difference between static and dynamic binding of functions?
an integer constant must have atleast one a) character b) digit c) decimal point
What is low level language in simple words?
What is the use of this pointer in c++?
Inline parameters : What does the compiler do with the parameters of inline function, that can be evaluated in runtime ?
Reverse the Linked List. Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL
How does the copy constructor differ from the assignment operator (=)?
What are smart pointers?