C++ Interview Questions

Bjarne-stroustrup
 
Prev3 of 17Next

According to the C++11 standard, what is the output of this program?

#include <iostream>

void f(int) { std::cout << 1; }
void f(unsigned) { std::cout << 2; }

int main() {
	f(-2.5);
}

Answer