using result of a program

Hi every.
I have a question. I have 2 different programs. I want to use the result of the first program in the second program. Can anyone show me one example about this. thank you!
Nobody can help you according to your such general description i think.
I have:
1
2
3
4
5
6
7
8
9
file1.cpp
#include<iostream>
using namespace std;
int main()
{
        int x;
        cin>>x;
        return 0;
}

1
2
3
4
5
6
7
8
9
file2.cpp
#include<iostream>
using namespace std;
int main()
{
        int y;
       .....
        return 0;
}

I want y=x. What must I do?
Topic archived. No new replies allowed.