Writing input into separate arrays and an output file
It's a good idea to order your STL #includes either alphabetically or by groups (see this answer for more details).  Header files should also precede STL #includes to avoid dependencies.
I'd give your IO files more accurate names (such as inFile and outFile).
Include &lt;cstdlib&gt; for EXIT_FAILURE.
This is C++ and not C, so use std::size_t instead of size_t.
Put the std::vector declarations (A1, B1, C1) on separate lines.
You don't have to create another size variable for A1.size() just for a loop.

In that same loop: you're looping through all three arrays at once, but are using one vector's size to do that.  That's a bad idea.  If they happen to be different sizes, you're going to run into problems.
This:

int n1 = sub(n, &amp;A1[0], &amp;B1[0], &amp;C1[0]);


is best written as this (with iterators):

int n1 = sub(n, A1.begin(), B1.begin(), C1.begin());