In one cpp file I have three particular variables and a loop. From within this loop I want to pass the three variables to a function in another cpp file. Before I do this I want to pass them to an intermediate function in another cpp file for some processing.

If that intermediate function could return three values then I'd have no problem. I've considered calling the third function from the second but I'd rather keep all the calls from within the original loop to save any future confusion. I've thought of using pointers to variables but that seems untidy, and I can only think of using global variables otherwise.

Is there a good way of doing this or even a creative workaround?