Skip to content
Quiz · Functions · lesson 8 of 13

Quiz — which overload the compiler picks

What does the program print?

C++
#include <iostream>

void print(int) { std::cout << "int"; }
void print(long) { std::cout << "long"; }
void print(double) { std::cout << "double"; }

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

Subscribe to take the course

The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.

Sign in another way