Prateek Sir and Coding

What is the error in my code?

#include <bits/stdc++.h>
using namespace std;
class Stack {
private:
vector v;
public:
void push(int data) {
v.push_back(data);
}
bool isempty() {
return v.size()==0;
}
void pop() {
if(!isempty()) {
v.pop_back();
}
}
int top() {
return v[v.size()-1];
}
};
int main() {
Stack s1;
int q,t,p;
cin>>q;
for(int i=0;i<q;i++) {
cin>>t;
if(t==2) {
cin>>p;
s1.push§;
}
else {
cout<<s1.top()<<"\n";
s1.pop();
}
}
return 0;
}

Save your code on ide.codingblocks.com and then share its link.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.