error. please help. expected primary expression before int (func_call=checking(int i));

#include<iostream>
using namespace std;
int checking(int i)
{
for (i=0;i<=1000;i++)
{
cout<<"this is the range:"<<i<<endl;
cout<<"this programme sucks";
}
}

int main()

{
return 0;
}

int func_call, i;
func_call=checking(int i);
cout<<i<<endl;
Scope. Shouldn't those troublesome lines be within some function, like the main()?
this ur correct programm..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 #include<iostream>
using namespace std;
void checking(int i)
{
for (i=0;i<=1000;i++)
{
cout<<"this is the range:"<<i<<endl;
cout<<"this programme sucks";
}
}

int main()

{
int i;
i=0;
checking(i);
cout<<i<<endl;
return 0;

}



be aware of where you are placing return or getch statements in void main. they should appear at the end of the program.
thanks guys ....it worked :)
Topic archived. No new replies allowed.