P
parag_paul
#include <iostream>
using namespace std;
void ha(int& j);
void ha(int& j) {
cout <<j<<endl;
}
main()
{
int j = 0;
ha(NULL);
}
Why so ,
gcc version 3.3.6
p236.cc: In function `int main()':
p236.cc:14: error: invalid initialization of non-const reference of
type 'int&'
from a temporary of type 'long int'
p236.cc:6: error: in passing argument 1 of `void ha(int
using namespace std;
void ha(int& j);
void ha(int& j) {
cout <<j<<endl;
}
main()
{
int j = 0;
ha(NULL);
}
Why so ,
gcc version 3.3.6
p236.cc: In function `int main()':
p236.cc:14: error: invalid initialization of non-const reference of
type 'int&'
from a temporary of type 'long int'
p236.cc:6: error: in passing argument 1 of `void ha(int