일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Algorithm
- tensorflow
- Linear_regression
- Python
- 인공지능
- logistic regression
- Softmax classification
- 텐서플로
- AI
- 기능개발
- pwnable.kr
- leg
- programmers
- Today
- Total
목록C++/윤성우 (3)
나혼자 공부장

Chapter 13에서 공부한 내용의 확장 1. Point 클래스 템플릿과 배열 클래스 템플릿 만약 클래스 템플릿을 기반으로 템플릿 클래스의 객체를 저장해야 하는 경우도 있을 것이다. 아래와 같이 선언한다. BoundCheckArray oarr(50); BoundCheckArray oparr(50); /*** typedef 선언 사용 ***/ typedef Point* POINT_PTR; BoundCheckArray oparr(50); 2. 특정 템플릿 클래스의 객체를 인자로 받는 일반함수의 정의와 friend 선언 /*** 특정 템플릿 클래스에 한정해서 멤버 함수 선언 ***/ #include using namespace std; template class Point { private: T xpos, ..

#include using namespace std; class Point { private: int xpos, ypos; public: Point(int x = 0, int y = 0) : xpos(x), ypos(y) {} void SetPos(int x, int y) { xpos = x; ypos = y; } void ShowPosition() const { cout

템플릿에 대한 이해와 함수 템플릿 함수 템플릿 : 함수를 만드는 도구 함수 템플릿은 다양한 자료형의 함수를 만들어낼 수 있다. 함수의 기능은 정해져있고, 용도에 따라 달라지는 자료형을 결정하기 위한 템플릿이라고 이해하면 된다. 아래와 같이 정의한다. template //template 와 같은 의미 T add(T num1, T num2){ return num1+num2; } 예제 1. /* 덧셈 템플릿 구현 및 사용 */ #include using namespace std; template T Add (T num1, T num2){ return num1+num2; } int main(void) { cout