add Chapter06
This commit is contained in:
17
Chapter06/function_overloading.cpp
Normal file
17
Chapter06/function_overloading.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <cstdio>
|
||||
|
||||
void print(int a) {
|
||||
printf("Int %d\r\n", a);
|
||||
}
|
||||
|
||||
void print(float a) {
|
||||
printf("Float %2.f\r\n", a);
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
print(2);
|
||||
print(2.f);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user