What happens when you attempt to compile and run the following code?
#include
using namespace std;
template
void f(A &a)
{
cout<<1< } void f(int &a) { cout<<2< } int main() { int a = 1; f(a); return 0; }
}
void f(int &a)
cout<<2< } int main() { int a = 1; f(a); return 0; }
int main()
int a = 1;
f(a);
return 0;
program displays: 1
program displays: 2
compilation error
runtime exception
Submit