Doubt on Stacks and Structures in Stacks

Revision en1, by chari407, 2018-02-04 08:17:02

Hi, I have a couple of doubts. 1. Can we use the standard C++ binary_search() on a stack<> ? 2. Suppose I declare

struct sig
{
int a;
int b;
};

sig temp[10];

stack<sig> trial;

Now I push a few "sig" elements to the "trial" stack. How do I access the second value (b) of the topmost element in the stack ?

Tags stack, data structures

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English chari407 2018-02-04 08:17:02 381 Initial revision (published)