Click here to Skip to main content
15,078,444 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C++
int global=10;
void func(int&x,inty)
{
x=x-y;
y=x*10;
cout<<x<<','<<y<<'\n';
}
void main()
{
int global=7;
func(::global,global)
cout<<global<<','<<::global<<'\n';
func(global,::global);
cout<<global<<','<<::global<<'\n';
}
Posted
Updated 22-Mar-15 2:17am
v2

Quote:
void func(int&x,inty)
Compile error.
   
Comments
Afzaal Ahmad Zeeshan 22-Mar-15 8:25am
   
+5, Not only this one... There are quite a lot of other problems too, starting with this one. :D See Solution 2. :)
A lot of errors is the output of this program. Look for yourself, http://cpp.sh/3esj[^] I would not enlist all of the problems in your code. :)
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900