pop op doesn't return anything...use top.something like that op. Rahul.
On Tue, May 17, 2011 at 9:29 AM, Akshata Sharma <akshatasharm...@gmail.com>wrote: > can someone please tell me why I am getting this error? > > #include<iostream> > #include<stack> > #include<conio.h> > > using namespace std; > > int main() > { > stack<pair<int,int> > stk; > stk.push(make_pair(2,1)); > stk.push(make_pair(3,2)); > > pair<int,int> p = stk.pop(); //at this line I am getting error > "conversion from `void' to non-scalar type `std::pair<int, int>' > cout<<p.second; > > getch(); > return 0; > } > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.