There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Software Development
Tag Cloud
audio blue screen boot bsod computer cpu crash dell desktop driver drivers error excel external hard drive firefox freezes freezing hard drive hardware hijackthis internet internet explorer itunes laptop mac malware motherboard mouse network networking outlook 2007 power printer problem ram router screen slow sound trojan usb virus vista vista 32-bit windows windows vista windows xp winxp wireless wmp
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
C++: Using M$ STL List and Stack classes


Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
AlbertB's Avatar
Distinguished Member with 2,432 posts.
 
Join Date: Nov 2002
Location: Hampshire, UK
05-Mar-2004, 01:59 PM #1
Solved:- C++ Using M$ STL List and Stack classes
I'm not sure if this is the place to expect some help on this sort of topic but does anyone have experience in using M$ STL <list> and <stack> implementations?

I want a way to read all of the elements of a list, (each of which are multi-data element classes), and can only see a very complex procedure to do it.

I can transfer the data from the element on the back of the list into a dummy element, item by item. Pop the back element, and push the dummy copy onto the front. Repeat this for every element and the list is back where it started.

I cannot find anything helpful in the Help file, but I cannot believe there is no function defined to simply read, or even pop and retrieve, the element at the back, (or front).

Eventually I will need to do this sort of thing with a stack too, and if it can't be done simply for a list .......

Frustrating!!!
__________________
1. "I make no personal claim to the truth, only the right to seek it, prove it in argument, and to be wrong many times in order to reach it."

2. "We have made a cage of words and placed our God inside, as boys trap a cricket, to make him sing for us alone."

Galileo Galilei

Last edited by AlbertB : 05-Mar-2004 02:21 PM.
AlbertB's Avatar
Distinguished Member with 2,432 posts.
 
Join Date: Nov 2002
Location: Hampshire, UK
05-Mar-2004, 02:16 PM #2
Sorry to be a pain but my problem is solved. Functions like "back" and "front" return a copy of the whole data structure of the class of which the list comprises. So with a dummy object of that class something like

dummy_Object = list.back()

simply transfers all of the data from the object in the list to my dummy. Then I can simply "pop_back()" and "push_front( dummy_Object )".

Much simpler than I had first thought.

Is this the first time some plonker has posted a problem and written his own solution 5 minutes later?

Got to get my tech count up somehow I suppose.
__________________
1. "I make no personal claim to the truth, only the right to seek it, prove it in argument, and to be wrong many times in order to reach it."

2. "We have made a cage of words and placed our God inside, as boys trap a cricket, to make him sing for us alone."

Galileo Galilei
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 08:19 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.