+ 6
Is there default constructor in this code?
// CPP program to demonstrate working of STL stack #include <iostream> #include <stack> using namespace std; void showstack(stack <int> s) { while (!s.empty()) { cout << '\t' << s.top(); s.pop(); } cout << '\n'; } int main () { stack <int> s; s.push(10); s.push(30); s.push(20); s.push(5); s.push(1); cout << "The stack is : "; showstack(s); cout << "\ns.size() : " << s.size(); cout << "\ns.top() : " << s.top(); cout << "\ns.pop() : "; s.pop(); showstack(s); return 0; }
2 Answers
+ 5
Is there a destructor in the code?
+ 5
Do you write names? Ot do you also include something like @ before the name to make a name green?