|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Guys, sorry i couldnt write any code because i have no idea.
This is my homework and i must do it. Can u say any tips or show example codes ? In anyhelp , i will be glad. Thanks. The program has three threads. All threads share an array A of n integers, where n is a command line parameter. The main thread of the program initially fills the array with random integers in the range 1…n and creates two search threads. The search threads run the same function search(int A[], int size, char direction, int target) The function searches half of the array for the target and prints the indices where it is found. Target is also a command line parameter. A typical run of the program is as follows: ./a.out 12 4 thread 1: found 4 at index 0 thread 2: found 4 at index 10 thread 2: found 4 at index 8 thread 1: found 4 at index 5 |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |