#include <iostream>
usingnamespace std;
int defaultPara (int x = 100, int y = 200, int z = 300);
int staticVar();
int main ()
{
int n = defaultPara (10, 20, 30);
int m = defaultPara (10, 20);
cout << n << endl; //64 Working: 10 + 20 + 30 + 4 = 64
cout << m << endl; //338 Working: 10 + 20 + 300 + 8 = 338
cout << staticVar () << endl; //16 when x = 8, staticVar() = 8 * 2
cout << (n >> 3) << endl; //8
cout << ((n & m) << 1) << endl; //128
return 0;
}
int defaultPara (int x, int y, int z)
{
return x + y + z + staticVar();
}
int staticVar()
{
staticint x = 2;
x *= 2;
return x;
}
I am wondering what will be the workings for
cout << (n >> 3) << endl; //Is it 64/3?
cout << ((n & m) << 1) << endl; //How about this?