最近的C++ int
initialization 总是出错,在这里提醒自己一下。
无论是数组还是变量的初始化,一定要explicitly set 0.
【c++|c++ int initialization】example:
int* rows;
int* cols;
int diagonal;
int anti_diagonal;
rows = new int[n]{0};
cols = new int[n]{0};
diagonal = 0;
anti_diagonal = 0;