I know I shouldn't post my whole problem here, but I'm just really stuck on even a starting point. I've done a fair bit of research but can't really come up with a plan for this, being very new to C programming.
So I'm just wondering if someone could point me in the right direction or give me a few tips for this program I'm trying to build.
For each command-line argument, I want to use fork() to create a child process to handle that argument. Each child process should determine if the command-line argument it is processing is a valid filename. If not, or if the child process cannot open or read the file, the child process should return an exit status of -1. If the child process can read the file, it should count the number of lines in the file and return an exit status of 0 if there are an even number of lines, or 1 if there are an odd number of lines in the file. The parent process should cause all the child processes to execute in parallel and examine their return values to determine whether, overall, there is an even or odd number of lines in all the files (files that did not exist/could not be read should be excluded). The parent process should print (to standard output) "Even" if there were an even number of lines, or "Odd" if there were an odd number of lines. It should then exit with a status of 0 if the result was even, or 1 if the result was odd.