3 is the number of each gender.
All the men names are separated by a space. All the women names are also separated by a space.

How do I read in all the names into an array and then access ONE name from each line?

I tried something like:

Code:

for (i=0; i < numPairs; i++){

fscanf(ifp, "%s", &nameOfPerson)
}

Where nameOfPerson is declared as an char array of size 20 (since each name is 20 characters in length max).

So how would I access the name bob skipping the rest of the names? or how would I access the name whitney skipping the rest of the names?

Thanks in advnace!

(Please give me a helpful answer b/c I am working a big comparison project in Computer science where I need to use recursion and I do not want to spend too much time on figuring out generalized hints)

09-20-2010

Elysia

fgets + strtok is probably a good idea.
Be sure to read SourceForge.net: Scanf woes - cpwiki
Note that the fscanf is dangerous and it's wrong. Don't use & on arrays; arrays implicitly decay to pointers.