array filling in function Prime-please, they are requiring this!!!

invalid conversion from 'int' to 'int*' ???

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
  
int e=1;
for (int i=2; i<st; i++){
if (st%i==0)
{
e=0;
break;
}


}


if(e==1){array_f[k]=st;}
k+=1;
m+=st;
st+=1;


}// do
while(k==4);
return m;
}

int main(){
int b=23;
cout<<Prime(b);
return 0;
}


Please, help_ many thanks!
Last edited on
Could you post your complete code.
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
32
#include<iostream>
using namespace std;

int Array_elements_sum(int st){
int e=1;
for (int i=2; i<st; i++){
if (st%i==0)
{
e=0;
break;
}


}


if(e==1){array_f[k]=st;}
k+=1;
m+=st;
st+=1;


}// do
while(k==4);
return m;
}

int main(){
int b=23;
cout<<Prime(b);
return 0;
}
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
32
int Average(int array_f[5], int st){
int m=0;
int k=0;
int e=1;
for (int i=2; i<st; i++){
if (st%i==0)
{
e=0;
break;
}


}


if(e==1){array_f[k]=st;}
k+=1;
m+=st/5;
st+=1;


}// do
while(k==4);
return m;
}

int main(){
int b=23;
cout<<Prime(b);
return 0;
}
Topic archived. No new replies allowed.