Question: In this task, you are required to write a simple C++ program using a struct to pass multiple arguments to threads (namely, ID and data).

In this task, you are required to write a simple C++ program using a struct to pass multiple arguments to threads (namely, ID and data). Things to note: Your program should take the file name as a command line argument. For each thread created a message should be printed including the threads ID. Your program should create a thread for each line it reads from the file, and send that line to the thread to print as well as the threads ID. The thread should then print out the correct string. Remember this data has to be read and displayed in the order as seen in the file. You can create your own txt file for your testing. On demo days, you will be given a new txt for testing your code. Your output should look something like this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
