You should probably work on your function names. You have a function called openInput which not only opens but also reads the input. This input is read into local variables and written to stdout. These values are not available to the rest of the program as soon as the function returns.
You have another function named openOutput which opens and then immediately closes an output file.
Your third function fileData appears to be the function that will do the work that needs to be done. In needs an input file to read data from and an output file to write data to.
I recommend that openInput should only open the input file and openOutput should only open the output file (nothing else except except error checking that the file opened). These open files are returned by reference to main(). At that point you can pass the open files to fileData which reads the input, processes it, and writes the output to the output file.
Before leaving main you should close the input and output files, but you don't need separate functions for that--simply call openInput.close();