Containers and Structures 
Author Message
 Containers and Structures

I'm very new to C++ and the standard library. I'd like to know if you
can create a container (say, a Vector or List) which contains a
structure? If so, can you give a real life (but small) example. One
that actually works.

Thanks... Gary.

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sun, 25 Aug 2002 03:00:00 GMT  
 Containers and Structures


Quote:
> I'm very new to C++ and the standard library. I'd like to know if you
> can create a container (say, a Vector or List) which contains a
> structure? If so, can you give a real life (but small) example. One
> that actually works.

> Thanks... Gary.

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sure, a list of lists, or a list of people, or a list of lists of
people.

I ain't so good at STL, but wouldn't you write something like

List<List<int>> lli;

...to create a list of lists of ints?

(sorry for the poor example)

/A

--
+---------------------+
| Andreas K?h?ri
| Uppsala University
| Sweden

Sent via Deja.com http://www.deja.com/
Before you buy.



Sun, 25 Aug 2002 03:00:00 GMT  
 Containers and Structures

Quote:

> I'm very new to C++ and the standard library. I'd like to know if you
> can create a container (say, a Vector or List) which contains a
> structure? If so, can you give a real life (but small) example. One
> that actually works.

> Thanks... Gary.

> Sent via Deja.com http://www.deja.com/
> Before you buy.

why don't you ask this in clc++??? This is not the right ng:-(

Z



Sun, 25 Aug 2002 03:00:00 GMT  
 Containers and Structures


Quote:

> > I'm very new to C++ and the standard library. I'd like to know if
you
> > can create a container (say, a Vector or List) which contains a
> > structure? If so, can you give a real life (but small) example. One
> > that actually works.

> > Thanks... Gary.

> > Sent via Deja.com http://www.deja.com/
> > Before you buy.

> why don't you ask this in clc++??? This is not the right ng:-(

> Z

I have... twice... apparently they don't know the answer, so I thought
I'd try here... sorry if I bothered you!!!

Sent via Deja.com http://www.deja.com/
Before you buy.



Sun, 25 Aug 2002 03:00:00 GMT  
 Containers and Structures

Quote:




>> > I'm very new to C++ and the standard library. I'd like to know if
>you
>> > can create a container (say, a Vector or List) which contains a
>> > structure? If so, can you give a real life (but small) example. One
>> > that actually works.

>> why don't you ask this in clc++??? This is not the right ng:-(

>> Z

>I have... twice... apparently they don't know the answer, so I thought
>I'd try here... sorry if I bothered you!!!

I suspect that in fact many many of them do know the answer, but
consider it so simple that they are not bothering to reply. And why
you thought that comp.lang.c should be able to help is an utter
mystery.

<OT>
just do it. it will work.
</OT>

Mark McIntyre

C- FAQ: http://www.eskimo.com/~scs/C-faq/top.html



Sun, 25 Aug 2002 03:00:00 GMT  
 Containers and Structures
: I'm very new to C++ and the standard library. I'd like to know if you
: can create a container (say, a Vector or List) which contains a
: structure? If so, can you give a real life (but small) example. One
: that actually works.

You posted to comp.lang.c, a C programming group. C is a different language
than C++.  Try posting your question to comp.lang.c++

Paul

--
Paul D. Boyle

North Carolina State University
http://laue.chem.ncsu.edu/web/xray.welcome.html



Sun, 25 Aug 2002 03:00:00 GMT  
 Containers and Structures

Quote:





> >> > I'm very new to C++ and the standard library. I'd like to know if
> >you
> >> > can create a container (say, a Vector or List) which contains a
> >> > structure? If so, can you give a real life (but small) example.
One
> >> > that actually works.

> >> why don't you ask this in clc++??? This is not the right ng:-(

> >> Z

> >I have... twice... apparently they don't know the answer, so I
thought
> >I'd try here... sorry if I bothered you!!!

> I suspect that in fact many many of them do know the answer, but
> consider it so simple that they are not bothering to reply. And why
> you thought that comp.lang.c should be able to help is an utter
> mystery.

> <OT>
> just do it. it will work.
> </OT>

> Mark McIntyre

> C- FAQ: http://www.eskimo.com/~scs/C-faq/top.html

Actually, the fact that you and Zoran display such an unhelpful
attitude is a MYSTERY to me. I didn't know that these forums were only
for HARD questions.

Forget I asked...

Sent via Deja.com http://www.deja.com/
Before you buy.



Mon, 26 Aug 2002 03:00:00 GMT  
 Containers and Structures
Quote:

> I'm very new to C++ and the standard library. I'd like to know if you

                  ===> comp.lang C++ is just down the hall...try there

Quote:
> can create a container (say, a Vector or List) which contains a
> structure? If so, can you give a real life (but small) example. One
> that actually works.

> Thanks... Gary.

> Sent via Deja.com http://www.deja.com/
> Before you buy.

--
Artie Gold, Austin, TX  (finger the cs.utexas.edu account for more info)

--
A: Look for a lawyer who speaks Aramaic...about trademark infringement.


Mon, 26 Aug 2002 03:00:00 GMT  
 Containers and Structures

Quote:
>> >> > I'm very new to C++ and the standard library. I'd like to know if
>> >you
>> >> > can create a container (say, a Vector or List) which contains a
>> >> > structure? If so, can you give a real life (but small) example.

<...>

Quote:
>Actually, the fact that you and Zoran display such an unhelpful
>attitude is a MYSTERY to me. I didn't know that these forums were only
>for HARD questions.

Excuse me, but what attitude are you talking about ? You was asking a
question about C++ and you have been kindly redirected to clc++. What's
wrong with that ? Obviously the C specialists are not supposed to be
competent in C++ (or Pascal or whatever). The topic of this ng is the C
language. May be you are confusing C and C++. If so, you must admit that
there are different languages.

--
-hs- "Stove"
CLC-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
ISO-C Library: http://www.dinkum.com/htm_cl
"It's specified. But anyone who writes code like that should be
transmogrified into earthworms and fed to ducks." -- Chris Dollin CLC



Wed, 28 Aug 2002 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Having a container vested in another container

2. OLE Server Container fast switching of document and container crashes

3. Referring to structure member inside structure

4. Array of Structures in a Structure.

5. structure type includes incomplete structure?

6. Marshaling a structure containing a aray of different structures

7. Help with structuring a structure:)

8. Problem using structures in structures

9. Structure to Structure

10. Need help in declaring a C# structure from C structure

11. structures within structures

12. Q about structures within structures

 

 
Powered by phpBB® Forum Software