📅  最后修改于: 2022-03-11 14:44:58.449000             🧑  作者: Mango
// 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);