0
Why we can't write the functions like this?
#include <iostream> using namespace std; void printNumber(int x) { cout << "Prints an integer: " << x << endl; } void printNumber(float x) { cout << "Prints a float: " << x << endl; } int main() { printNumber(2); printNumber(2.1); }
2 Respostas
+ 1
Thank's, it is working!