User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 427,812 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,845 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums

ASK about C++ stack

Join Date: Mar 2007
Posts: 2
Reputation: daphnie is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
daphnie daphnie is offline Offline
Newbie Poster

Help ASK about C++ stack

  #1  
Mar 1st, 2007
Please help me!!!
How can I do the below ex. , please help me!!!

Description:
In this assignment you will implement the ADT Stack. You
will be using stacks in order to count the pairs of three types
of brackets: {}, [], and (). The input will consist of an input
stream of characters, text and numerics. The input will have
embedded brackets occuring in pairs. For example:
Main(int argc, char** argv) { int A[100]; double B[50]; }
Your program should run with this input stream, for example:
$ ../bin/main < ../dat/input.dat
The output should be:
$ Number of () pairs = 1
$ Number of [] pairs = 2
$ Number of {} pairs = 1



Example of an input stream:
(((123)[1]{1(2345)}))
The following should result in an
error:
((…{...1234 })}}
Any crossing pair match should
also trigger an error.


Thank you all of you!!
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 2:30 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC