void ThreadProc(void){
};
Thread^ oThread = gcnew Thread( gcnew ThreadStart( this,&qualifiedlist::ThreadProc ) );
oThread->Start();
I have another simplar thread like this but its more complex. I try to set variables in it like this, for example.
int y;
void ThreadProc(void){
y=9;
};
Thread^ oThread = gcnew Thread( gcnew ThreadStart( this,&qualifiedlist::ThreadProc ) );
oThread->Start();
cout<<y;
y will be 0!
This is veryyy simple stuff, but if i cout<<y; from outside of the ThreadProc it will be 0 always. I have tried a few other things, i dont ever remeber having this problem, i have been coding for 5 years,so am i nuts? Or should i use a delegate or something? thanks

New Topic/Question
Reply


MultiQuote






|