For Programmers: Free Programming Magazines  


Home > Archive > C# > June 2004 > Equivalent STL vectors









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Equivalent STL vectors
Douglas Dillon

2004-06-03, 7:31 pm

I am a C++ developer trying to learn the new technology. I am working
on an app that will need to hold an array of strings (unknown size).
What is the appropriate method for creating vectors? The MSDN isn't
helping.

Thanks,

Douglas
Ed Anady

2004-06-07, 4:00 pm

Use an ArrayList if you don't know the size of the array.

ArrayList list = new ArrayList();
list.Add("String 1");

You can access the items by an indexer or by the foreach construct.
Hope this helps.

Ed Anady


douglasjd2000@yahoo.ca (Douglas Dillon) wrote in message news:<8e1a60d3.0406031252.ee5e849@posting.google.com>...
> I am a C++ developer trying to learn the new technology. I am working
> on an app that will need to hold an array of strings (unknown size).
> What is the appropriate method for creating vectors? The MSDN isn't
> helping.
>
> Thanks,
>
> Douglas

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com