Threads in c++

I want to write c++ code for following problem.
Use two threads to show two rotating bars at the two top corners of a screen. Basically each thread will be driving the “rotation” of the bar. (Hint: You can use “\” and “/” to achieve the effect but you will have to figure out how to achieve the effect of “rotation”.)
Last edited on
http://www.cplusplus.com/reference/multithreading/

But before you even get that far, you need to be able to do this.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void top_left ( ) {
  // animate a single iteration of /-\| in the top left corner
}
void top_right ( ) {
  // animate a single iteration of /-\| in the top right corner
}
int main ( ) {
   for ( int i = 0 ; i < 20 ; i++ ) {
      top_left();
      sleep(1);
   }
   for ( int i = 0 ; i < 20 ; i++ ) {
      top_right();
      sleep(1);
   }
}


Registered users can post here. Sign in or register to post.