Friday, July 31, 2009

Write Function in C-programming to count numbers stored in a stack or buffer.?

I should be simple to understand...................

Write Function in C-programming to count numbers stored in a stack or buffer.?
In very general terms the internals of a function are roughly





Function (variable to be passed in [stack or buffer pointers] , output pointer sto variable if needed for answer)





1) Initialise the module - declare constants, initialise counters etc, reserve memory if needed, etc.





2) Loop to count each item, with a test to exit when the last item is reached.





3) release memory if needed, etc, pass back any necessary pointers to any needed variable, etc
Reply:wud u plz clearly mention wat u want
Reply:int countStackSize() {


return stack.size();


}


No comments:

Post a Comment