Why does this code print out n-100?
int hello(int n)
{
for(int i = 0; i < n-100; i++)
{
}
}
int main()
{
int h = hello(12);
cout << hello(12) << " " << h << endl;
}
Yet, both of these function return garbage (2665092 and 0 respectively)
int hello1(int n)
{
for(int i = 0; i < 12; i++);
}
int hello2(int n)
{
(n - 100);
}
I compiled this code using g++ in the cygwin environment.