Created
May 16, 2017 17:42
-
-
Save tornikegomareli/b33931af3501e7225e52523a4b324b44 to your computer and use it in GitHub Desktop.
template functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| template <typename T> | |
| void print(int a, T b) | |
| { | |
| cout << " a = " << a << endl; | |
| cout << " b = " << b << endl; | |
| } | |
| template <typename T> | |
| void print(int a, T b) | |
| { | |
| cout << " a = " << a << endl; | |
| cout << " b = " << b << endl; | |
| } | |
| int main() | |
| { | |
| print(123, 'a'); | |
| print(123, 125); | |
| cin.get(); | |
| cin.get(); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment