Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
onihusube authored Aug 23, 2019
1 parent c90f238 commit 2f98507
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 032-memory-allocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,14 @@ logger_ptr->~Logger() ;
## new/delete
クラスのオブジェクトを動的確保するのに、生の文字列の確保/解放と、クラスのオブジェクトの構築/破棄をすべて自前で行うのは面倒だ。幸い、確保と構築、破棄と解放を同時にやってくれる機能がある。`new式`と`delete式`だ。
クラスのオブジェクトを動的確保するのに、生のメモリーの確保/解放と、クラスのオブジェクトの構築/破棄をすべて自前で行うのは面倒だ。幸い、確保と構築、破棄と解放を同時にやってくれる機能がある。`new式`と`delete式`だ。
~~~c++
new 型 new初期化子
delete ポインター
~~~

`new式`は生のメモリーを確保し、型のオブジェクトを構築し、型へのポインターを返す
`new式`は生のメモリーを確保し、型のオブジェクトを構築し、そのオブジェクトへのポインターを返す

~~~cpp
int * int_ptr = new int{123} ;
Expand Down

0 comments on commit 2f98507

Please sign in to comment.