template (4) 썸네일형 리스트형 [JSP] template 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 31 32 33 34 35 36 37 38 39 40 41 42 Include Colored by Color Scripter cs template.jsp 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Insert title here 신상품 인기상품 Colored by Color Scripter cs left.jsp 다른 페이지는 중요하지 않으므로 스킵 [C++] Template(템플릿) 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 #include #include using namespace std; template void change(T &a, T &b) { int temp; temp = a; a = b; b = temp; } void main() { int a = 1, b = 2; char c = 'A', d = 'B'; float e = 3.7f, f = 4.3f; change(a, b); cout [C++] Template 함수 (템플릿 함수) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 #include #include using namespace std; template int Compare(T t1, T t2) { return t1 - t2; } int Compare (const char *str1, const char *str2) { return strcmp(str1, str2); } void main() { if (Compare(10, 5) > 0) { cout [C++] Template Class (템플릿 클래스) 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 #include #include #pragma once using namespace std; template class MyTemplate { T data; public : MyTemplate(T_data); int Compare(T in); operator T(); }; template MyTemplate ::MyTemplate(T_data) { data = _data; } template int MyTemplate::Compare(T in) { return data - in; } template MyTemplate::operator T() { return data; }.. 이전 1 다음