Hello buddies,

I have a function that is to be used in an n-time loop
That function is complex, so I am thinking if the following code snip is allowable to achieve what I'd like to


Code:
class Function
{
 public:
    struct Fun
    {
       CWinThread** pt;
       void AllocThread(UINT n)
       {
          *pt=new CWinthread[n]
       }
           
    };
   void Loop(int n);
}
//bk-workerthread: say, usigned int BKWT(LPVOID lp) {call the complex function}

//The loop function to hook up and use the bkwthread
Code:
void Function::Loop(int n)
{  
    Fun*p=NULL;
    p.AllocThread(n);
    for(int i=0;i<n;i++)
    {
       p->pt[i]=afxbeginthread(xxxxxxxx);
    }
}
Someone please help me

Thank you