📜  c++ 用 0 填充数组 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:58.449000             🧑  作者: Mango

代码示例1
// memset from 
memset(myarray, 0, sizeof(myarray)); // for automatically-allocated arrays
memset(myarray, 0, N*sizeof(*myarray)); // for heap-allocated arrays, where N is the number of elements
std::fill(myarray, myarray+N, 0);