Arguments of Threads: Undefined Behavior
Explore the causes of undefined behavior when passing thread arguments by reference in C++. Understand how detached threads can lead to unexpected results and prepare to learn solutions that prevent these issues.
We'll cover the following...
We'll cover the following...
As discussed in the previous lesson, here is another example of undefined behavior caused by improper handling of thread arguments.
The question is, what value does valSleeper have in line 29? ...