Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/solareenlo/42cpp-module-02
C++ practice 02 (Copy constructor, Operator overloading Fixed point number)
https://github.com/solareenlo/42cpp-module-02
42 42born2code 42cursus 42projects cpp
Last synced: 4 days ago
JSON representation
C++ practice 02 (Copy constructor, Operator overloading Fixed point number)
- Host: GitHub
- URL: https://github.com/solareenlo/42cpp-module-02
- Owner: solareenlo
- Created: 2021-05-26T10:28:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-29T03:06:28.000Z (over 3 years ago)
- Last Synced: 2024-11-08T02:47:06.640Z (about 2 months ago)
- Topics: 42, 42born2code, 42cursus, 42projects, cpp
- Language: C++
- Homepage:
- Size: 43.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 42cpp-module-02
### ex03
- [点と三角形の当たり判定( 内外判定 )](http://www.sousakuba.com/Programming/gs_hittest_point_triangle.html)
- [How to determine if a point is in a 2D triangle? [closed]](https://stackoverflow.com/questions/2049582/how-to-determine-if-a-point-is-in-a-2d-triangle)
- [const_cast conversion](https://en.cppreference.com/w/cpp/language/const_cast)### ex02
- 静的メンバ関数
- [C++で前置・後置インクリメント/デクリメント演算子をオーバーロードする](https://mickey24.hatenablog.com/entry/20081021/1224590753)
- [演算子オーバーロード | Programming Place Plus C++編【言語解説】 第19章](https://programming-place.net/ppp/contents/cpp/language/019.html#conversion_op)### ex01
- Fixed Point Number
- [Introduction to Fixed Point Number Representation](https://inst.eecs.berkeley.edu//~cs61c/sp06/handout/fixedpt.html)
- ostream 演算子のオーバーロード(`<<`)
- [Stream extraction and insertion](https://en.cppreference.com/w/cpp/language/operators)
- [C++演算子オーバーロード大全 Shift](https://qiita.com/rinse_/items/9d87d5cb0dc1e89d005e#shift)
```c++
float fl = 3.25;
std::cout << std::bitset(*reinterpret_cast(&fl)) << std::endl;
```### ex00
- [コピーコンストラクタ](https://programming.pc-note.net/cpp/constructor2.html)
- A `copy constructor` is used to initialize a previously uninitialized object from some other object's data.
- 「デフォルトコピーコンストラクタ」と「自分で定義するコピーコンストラク」がある.
- デフォルトコピーコンストラクタは,自分と同じクラスのインスタンスを引数とするコンストラクタで,メンバ変数をすべてコピーしたものが新しく作られる.
- 自分で定義するコピーコンストラクタは,自分自身のインスタンスの参照を引数に受け取るコンストラクタのこと.
- コピーコンストラクの禁止を行うこともできる.
- 代入演算子(`=`)
- An `assignment operator` is used to replace the data of a previously initialized object with some other object's data.
- 演算子のオーバーロード(`=`)
- [基本クラスを指すポインタは、その派生クラスも指すことができる](http://www.ced.is.utsunomiya-u.ac.jp/lecture/2012/prog/p3/kadai3/virtualfunc2.php)## References
### Coplien form
- [Coplien form example C++](https://stackoverflow.com/questions/21219590/coplien-form-example-c)### Understanding Floating Point Numbers
by Jeff Bezanson
- Every programmer should understand enough about floating point numbers to avoid the pitfalls of assuming perfect precision.
- [Background: Accuracy vs. Precision](https://www.cprogramming.com/tutorial/floating_point/understanding_floating_point.html)
- [Floating Point Representation](https://www.cprogramming.com/tutorial/floating_point/understanding_floating_point_representation.html)
- [Bonus: Printing Floating Point Numbers Cleanly](https://www.cprogramming.com/tutorial/floating_point/understanding_floating_point_printing.html)