일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Overloading
- member function
- call by value
- Effective C++
- Linear Regression
- virtual function
- 회귀
- regression
- 맵리듀스
- c++
- local minimum
- 딥러닝
- call by reference
- 지도학습
- struct
- overriding
- 머신러닝
- 비선형 함수
- Class
- 선형모델
- Machine learning
- 비선형모델
- 회귀학습
- Nonlinear Function
- MapReduce
- Nonlinear Model
- 최소제곱법
- inheritance
- kubernetes
- least square
- Today
- Total
목록Computer Language/C++ (24)
J's Study log
Factors can be declared in template. template class SimpleArray { private: T arr[len]; public: T &operator[] (int idx) { return arr[idx]; } }; int main(void) { SimpleArray i5Tint; SimpleArray i7Tdouble; i5Tint = i7Tdouble; //comfile error } Template Class Template class is built not only by 'T' but also 'int len'. So error in line17 is natural. Template class will be built like this code. class ..
Class Template Class template is for type of members in class. Class template sets the type while constructing. //member function defined inside the class #include using namespace std; template class Simple{ private: T sign; int num; public: Simple(T _sign, int _num):sign(_sign), num(_num) {} void Print(){ cout
Function Template It's a tool for making a function which needs to be called in many different types. //for example int Add(int num1, int num2) { return num1 + num2; } This function is for adding int type of variables. Let's change it into a function template. template T Add(T num1, T num2) { return num1 + num2; } template / template Means declare the following function into template by using 'T..
new operator There are three different of representative function of new operator. Memory Allocation Calling Constructor Type casting of returned address to appropriate type. Overloading new operator actually means not the overloading every function of new operator, you just change how to allocate the memory. In other words, the way of calling a constructor and type casting of returned address c..
Array in C, C++ have a bound issue, which can be a problem or not. So the following code can be excuted. int main(void) { int arr[5] = {1,2,3,4,5}; cout

Shallow Copy #include #include using namespace std; class Person { private: char* name; int age; public: Person(char *myname, int myage) { int len = strlen(myname) + 1; name = new char[len]; strcpy(name, myname); age = myage; } void ShowPersonInfo() const { cout