cpp2html 0.1-alpha © 2002 Andrea Leofreddi. To get the source click here

// 8.6: Overloading
#include <iostream>

using namespace std;

void prova(int a) {
	cout << "intero: " << a << endl;
}

void prova(float a) {
	cout << "float: " << a << endl;
}

void prova(char a) {
	cout << "char: " << a << endl;
}

void prova(int a, int b) {
	cout << "2 interi: " << a << ", " << b << endl;
}

int main() {
	prova(14);
	prova(2.0f);
	prova('z');
	prova(3, 3);
}