ya.. sorry my mistake! On Tue, May 17, 2011 at 9:31 AM, rahul <[email protected]> wrote:
> pop op doesn't return anything...use top.something like that op. > > Rahul. > > On Tue, May 17, 2011 at 9:29 AM, Akshata Sharma <[email protected] > > 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 [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]. > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
