banner
cells

cells

为美好的世界献上 code

Q002

Q002#

#include <iostream>

void f(float) {
    std::cout << "1";
}

void f(double) {
    std::cout << "2";
}

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

Answer#

click to see answer 21

Explain#

The type of a floating point literal is double.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.