C言語で動的メモリ割り当てしたい
from
C言語逆引きメモ
C言語で動的メモリ割り当てしたい
stdlib.hをインポート
code:c
*int mem = (int*) malloc(n * sizeof (int));
if (mem == NULL) {
// show error
}