Return maximum frequency number from stack

I designed one mfc vc++application in which data received from udp is stored in file as well as in stack.I used stl for stack; it stored elements as per receiving order,but i want to return repetitive number from stack,how to use stack as function parameter & retrieve elements of stack as an array? I write code for push elements in stack given below.If any changes in that function please suggest.
1
2
3
4
<template< typename T > void pushElements( T &stackRef,int value)
{
       stackRef.push( value);
}/>
retrieve elements of stack as an array?
Well, stack is not array. If you want that functionality use vector
Topic archived. No new replies allowed.