RSS Forums RSS
Please support our C++ advertiser: Programming Forums
Views: 1069 | Replies: 2 | Solved | Thread Tools  Display Modes
Reply
Join Date: Jul 2005
Location: Okc, OK
Posts: 25
Reputation: sifuedition is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
sifuedition's Avatar
sifuedition sifuedition is offline Offline
Light Poster

Unloading a stack to a string

  #1  
Sep 13th, 2005
What is wrong with this:
      for(int b = 0;b < c.length();b++)
      {
        temp[b] << S.Pop();  // or temp[b] = S.Pop();
      }
to have a string made up of the contents of the stack?

When I do this and cout << temp, temp is blank. This iterates through the loop properly, it just does not place the characters from the stack into the string.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Posts: 596
Reputation: SpS is on a distinguished road 
Rep Power: 5
Solved Threads: 31
SpS's Avatar
SpS SpS is offline Offline
Posting Pro

Re: Unloading a stack to a string

  #2  
Sep 13th, 2005
please tell us more about your code

how have u declared temp....defination of pop() function
Reply With Quote  
Join Date: Jul 2005
Location: Okc, OK
Posts: 25
Reputation: sifuedition is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
sifuedition's Avatar
sifuedition sifuedition is offline Offline
Light Poster

Re: Unloading a stack to a string

  #3  
Sep 13th, 2005
Sorry, I have managed to solve the issue.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 5:54 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC