I\'m trying to write a multi-threaded program, the number of threads based on command-line input, and so I can\'t hard-code pre-declared threads. Is this a valid way of doin
If you're trying to write a multithreaded program, but don't understand how to allocate a dynamically sized data structure, you may be doing things wrong.
Learn to walk before you run.
Consider using an easier language, and avoiding the use of (explicit) threads.
Threads are very difficult to use correctly; dynamically sized arrays are very easy to achieve (even fairly easy in C)