Solved

[noob][c++]  how do I establish a list ?

Posted on 2007-11-17
9
253 Views
Last Modified: 2010-04-01
for starting a set,


what I need is this


      set<int, greater<int> > s;
      set<int, greater<int> >::iterator i;




i want something as simple that above for list

and then i ll start a thread about lists' accessors and mutators.
0
Comment
Question by:Troudeloup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
9 Comments
 
LVL 53

Accepted Solution

by:
Infinity08 earned 300 total points
ID: 20305728
list<int> l;
list<int>::iterator i;


Did yo utake a look at the link I listed earlier ? You can get all the information on containers you need and a lot more there :

        http://www.cplusplus.com/reference/stl/

It will be a lot easier for you, and you'll learn a lot more by just reading that.
0
 
LVL 55

Assisted Solution

by:Jaime Olivares
Jaime Olivares earned 200 total points
ID: 20305730
the minimum you require for a list is:

list<int> l;
list<int>::iterator i;

i = l.begin();
access first element in list with *i
0
 

Author Comment

by:Troudeloup
ID: 20305734
i don't why, i have phobia toward that kind of links
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Troudeloup
ID: 20305739
oh, so first I have to point the iterator somewhere by doing, for instance

s.begin()


?
0
 
LVL 53

Assisted Solution

by:Infinity08
Infinity08 earned 300 total points
ID: 20305741
>> i don't why, i have phobia toward that kind of links

What do you mean ? It's a reference site for all STL containers. It groups all the information and makes it easily accessible. If I were you, I'd get over your phobia, because it's really the easiest way to get this kind of information.
0
 
LVL 55

Assisted Solution

by:Jaime Olivares
Jaime Olivares earned 200 total points
ID: 20305744
>>oh, so first I have to point the iterator somewhere by doing, for instance
>>s.begin()

yes
0
 
LVL 53

Assisted Solution

by:Infinity08
Infinity08 earned 300 total points
ID: 20305750
>> oh, so first I have to point the iterator somewhere by doing, for instance

Troudeloup, you seem to be very confused about containers. Really : read up on them first. That will already answer a lot of your questions.

Right now, you're just jumping around blindly, without really knowing what it's all about.
0
 

Author Comment

by:Troudeloup
ID: 20305759
ok.
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20305763
Indeed this is an experts forum, so you have to read all the theory first to have some level of expertise, then post here the hard questions.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question