티스토리 뷰
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
- rest parameter
- hackerrank solution
- ... in Javascript
- string class in java
- Collection Framework
- 알고리즘
- hackerrank javascript solution
- C++
- Object type casting
- equals()
- javascript
- compareTo()
- 프로그래머스 알고리즘
- HashMap
- spring boot application
- easy javascript algorithm
- math.max
- repeat()
- java
- hackerrank
- easy algorithm
- math.abs
- substring()
- code refactoring
- hackerrank javascript
- HackerRank Algorithm
- 프로그래머스
- Javascript Algorithm
- 프로그래머스 알고리즘문제
- algorithm
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함