Dynamic naming of a variable...


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Dynamic naming of a variable...

  1. #1
    nick Guest

    Dynamic naming of a variable...


    Just need a quick answer I am probably just being stupid but...

    if I want to create multiple threads and not have to name them individualy...
    but have a loop to create them how can i make them have unique names.

    if I have a variable that holds a string to name the threads and i try to
    use that would it not name the thread the name of my variable that is holding
    the string ? ex:

    string Name = "Thread1";

    while(true)
    {
    Thread **Name = new testThread(blah blah blah);
    Name++;
    } // How can i use the value of Name to give my threads names ?

    Any help is appriciated,
    Nick

  2. #2
    Paul Clapham Guest

    Re: Dynamic naming of a variable...

    They don't have to have names. Put them in an array, or a Vector if you
    don't know how many there will be.

    PC2

    nick <kingn@abacusokc.com> wrote in message news:3a883319$1@news.devx.com...
    >
    > Just need a quick answer I am probably just being stupid but...
    >
    > if I want to create multiple threads and not have to name them

    individualy...
    > but have a loop to create them how can i make them have unique names.
    >
    > if I have a variable that holds a string to name the threads and i try to
    > use that would it not name the thread the name of my variable that is

    holding
    > the string ? ex:
    >
    > string Name = "Thread1";
    >
    > while(true)
    > {
    > Thread **Name = new testThread(blah blah blah);
    > Name++;
    > } // How can i use the value of Name to give my threads names ?
    >
    > Any help is appriciated,
    > Nick




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center