Hello all. I am working with threads at the moment in my program. The thread is simple and looks like this.
Thread oThread = gcnew Thread( new ThreadStart( this,&qualifiedlist::ThreadProc ) );
I have another simplar thread like this but its more complex. I try to set variables in it like this, for example.
}; Thread oThread = new Thread( new 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