Question: Write a C or C++ program that accepts one command line argument which is an integer n between 2 and 4 inclusive. Generate a string
Write a C or C++ program that accepts one command line argument which is an integer n between 2 and 4 inclusive. Generate a string of length 60 which contains random lower case English characters and store them in a variable of suitable type of your choice. Use pthread to create n threads to convert the string into all upper case. (You may call the toupper and tolower functions declared in ctype.h). You should divide this conversion task among the n threads as evenly as possible. Print out both the lower case and upper case version of the string in separate lines.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
