The following code :
#include <iostream>
using namespace std;
int test()
{
cout<<"question \n";
return 0;
}
int main(){
cout<<test;
}
Output: question 1
The following code gives 1 everytime I run but I am expecting the output to be 0.
Whereas when I replace the test by test() then I get the expected output. Not sure why is this happening. Please suggest and comment if any rule behind it.