Help me please

Write your question here.
I have to create the following program in C++. Please help me, because I'm new in real time programming.
This is the requirement:
I have to make a C++ program that implements two tasks synchronized on a external event using mailboxes. The first task, T1, reads integer from keyboard, and record them to a vector. The second task, T2, transforms the integer numbers in binary and shows them. External events that are synchronized tasks is typing an integer.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream.h>
#include <conio.h>
int v[50], n, i;long sum;


void citire(){cout<<"dati numarul de elemente al vectorului:";cin>>n;
         for(i=1;i<=n;i++){cout<<"introduceti elementele vectorului: ";
                           cout<<"v["<<i<<"]= ";
                            cin>>v[i];
                            }}
void afisare(){cout<<"Elementele sirului sunt:"<<endl;
               for(i=1;i<=n;i++) cout<<" "<<v[i];}
void binar() {for(i=1;i<=n;i++) {
        do
    			{     long rem;int j=1;
                  rem=v[i]%2;
        			   sum=sum + (j*rem);
       			   v[i]=v[i]/2;
       			   j=j*10;
    			    	}while(v[i]>0);
    					cout<<"The binary of the given number is:"<<sum<<endl;}}



void main(){
citire();
afisare();
binar();
getch();

}  

I really need help with the tasks. Thanks!
Does this program build?
If not post the errors.

two things straightaway though, you want #include <iostream> and NOT #include <iostream.h>

the correct signature for main is int main(int argc, char* argv[])
The code runs, but it seems that the binary conversion is bad.. i will remediate this, but i need help with the tasks.

Here is a print screen : http://postimg.org/image/lyu6qky3h/
Make sure you reset j and sum correctly.
how can i do that?
Topic archived. No new replies allowed.