parenthesis checking...

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2008
Posts: 20
Reputation: zhinokin is an unknown quantity at this point 
Solved Threads: 0
zhinokin's Avatar
zhinokin zhinokin is offline Offline
Newbie Poster

parenthesis checking...

 
0
  #1
Sep 13th, 2009
hi to everyone...

i will make a program about parenthesis checking and my prof said that we will not be using a stack for this.

will you kindly help me to this..

aside from stack can you help me on what to use.?.
It's not a bug - it's an undocumented feature
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: parenthesis checking...

 
1
  #2
Sep 13th, 2009
So use a counter.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 20
Reputation: zhinokin is an unknown quantity at this point 
Solved Threads: 0
zhinokin's Avatar
zhinokin zhinokin is offline Offline
Newbie Poster

Re: parenthesis checking...

 
0
  #3
Sep 13th, 2009
Originally Posted by Salem View Post
So use a counter.
should i still use an array for this....?..
It's not a bug - it's an undocumented feature
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: parenthesis checking...

 
0
  #4
Sep 13th, 2009
  1. counter += 1*(ch=='(') - 1*(ch==')');
It's cryptic because anything simple is the whole answer on a plate.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC