1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #include <iostream> using namespace std; template <typename T> inline T SQUARE(T x){ return x*x; } int main(){ cout << SQUARE(5.5) << '\n'; return 0; } | cs |
'Programming Language > C++' 카테고리의 다른 글
C++ Template Function (0) | 2019.09.29 |
---|---|
C++ 최소값(min), 최대값(max) 그리고 minmax() (0) | 2019.09.28 |
C++ 문자열 정리 (String class) (0) | 2019.09.28 |
C++ 실수 mod (0) | 2019.09.25 |
C++ 피보나치 수열 (0) | 2019.09.25 |