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); }

11th Nov 2018, 6:19 PM
Igor The Golden Fish
Igor The Golden Fish - avatar
2 Respuestas
+ 1
Thank's, it is working!
11th Nov 2018, 6:54 PM
Igor The Golden Fish
Igor The Golden Fish - avatar