At the same time how can read

Hi rooters,
At the same time (in the loop)how can i read from two file ,for example :

......... ......... ifstream in("first.data"); ifstream in("second.data"); for (int i=0;i<100:i++) { in>>a; in>>b; c=a+b; }
but that is not correct .The compiler doesn’t know which is a and b;
I want to take “a” from “first.data”,“b”, from “second.data”.
Thanks.

Unless I am missing something, just use 2 different variable names:

ifstream in("first.data"); ifstream in2("second.data"); for (int i=0;i<100:i++) { in>>a; in2>>b; c=a+b; }

Cheers,
Philippe

Thank you very much,Philippe.
Best regards!