First time post and I am out of my league, so I apologize up front. I have reviewed C++ for Beginners, been on cplusplus, dreamincode, sanfoundry, tutorialpoint, learncpp and clicked every link yahoo, Google, and Bing will provide. I am trying to get some guidance for this: Create a random array of numbers (did that) and search it with the query integers from input.txt. Fork a child process for each query. The file input.txt is this:
5
13
24
6
17
20
1
51
36
42
2
19
67
35
64
91
96
84
72
I have to count the number of times each integer appears in the array (I have that, too). I could hard code each in to the algorithm I have, but I am asked to pass the values from input.txt by reading the file, and I cannot figure out how to do that. Also, if there are any suggestions for the fork(), I would take those also. Thank you!!! (I do realize I need to move on from "namespace" - sorry. I am getting there slowly.) Thanks, again!
Thank you! Very slick and it compiled nicely in cpp.sh. I need to go in reverse and have the input characters from the text file search my random number array in my program. Thanks to your example, however, it gave me a clue and I am working it out. It is slop at the moment, so I will post it when I get it cleaned up. I wanted to say thanks for the direction!