Please explain
Give the output of the following program 2
#include<iostream>
int global = 10;
void func(int &x, int y)
{
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";
If you want to memorize all the answers, you are doing the wrong thing.
Instead, you should learn the C++ language, then use simple logic to understand what the code does.
Start by reading the tutorials that MiiNiPaa linked to, in his post above.