Try changing to this:
int processFile(FILE *fileIn, int *sentences, int *words, int *lines, int *characters)
{
int ch;
...
if(ch == '\n' || ch == 60)
*lines++;
...
int main(void)
{
...
processFile(fileIn, &sentences, &words, &lines, &characters);
...
So, in this change, the function processFile
now takes four parameters by-pointer. When you access these parameters, use (for example) *lines
to dereference the pointer.
In main()
, when you call processFile()
, you pass addresses to your parameters.
Hope this helps; I think you want to learn about parameter passing in C/C++ (pass-by-value, pass-by-pointer, and pass-by-reference - you might want to Google for those terms).