Looks like the author of your book is actually a C programmer. In C++, you don't need to use the word struct every time you use one.
1 2 3 4 5 6 7 8 9 10
struct Results {
string words;
int t;
};
int main()
{
Results recResults[1000]; // NO use of word struct
}
return 0;
Your popArray function declaration has the third parameter as an int, and then you do this string popArray(ifstream&, string, Results recResults[]);
which is NOT calling the function. It's declaring another, different function.
Then your actual definition is different AGAIN, like this: string popArray(ifstream& inf, string sentence, Results recResults)
What do you want the third parameter to be?
That is the problem I'm affraid - I am new to structs/array of structs and as you can tell a bit confused. I am trying to use an array of structs and have never done this before - thus my question about syntax.
I am trying to pass struct members to an array of structs. In fact, in this particular function I am trying to populate the array with the struct member information.
At any rate, I keep wondering if I am using the syntax correctly because it would help if I know that I am at least calling these things correctly.