adspace


How a new element can be added or pushed in a stack?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What character terminates all character array strings a) b) . c) END

1397


What is the latest version on c++?

1209


Can union be self referenced?

1268


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1165


daily Routine of father

1485