티스토리 뷰
Function Overloading
Function overloading allows you to use the same function name for more than one definition in the same scope.
Function overloading has rules
first, it should have the same function name.
second, the number of arguments or the types should be different.
Example code
Result
When function 'func(4)' is called in main, function 'func(int a)' executed because it coincides with the type and the number of argument. And the same goes for func(int a, int b).
'C++' 카테고리의 다른 글
Class and Object in C++ (0) | 2018.11.06 |
---|---|
Dynamic Allocation in C++ (0) | 2018.11.03 |
Call by reference & Call by value with example code (0) | 2018.11.03 |
Array and Pointer example (0) | 2018.10.31 |
Double pointer(pointer to pointer) basic example code (0) | 2018.10.31 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- algorithm
- compareTo()
- math.max
- Collection Framework
- 프로그래머스 알고리즘
- rest parameter
- HackerRank Algorithm
- C++
- string class in java
- 프로그래머스 알고리즘문제
- spring boot application
- Javascript Algorithm
- Object type casting
- 프로그래머스
- hackerrank javascript
- 알고리즘
- easy algorithm
- hackerrank javascript solution
- repeat()
- hackerrank solution
- easy javascript algorithm
- java
- code refactoring
- ... in Javascript
- equals()
- HashMap
- math.abs
- javascript
- hackerrank
- substring()
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함