|
小弟是linux 下c++新手,以前学过c和fortran和vb,有点基础但是都忘差不多了,现在学习工作需要不得不要看一些源代码,一些指针什么的东西搞得我头痛啊,请问有什么好的方法自学c++,能推荐一些比较实用上手快的书籍吗?谢谢
比如下面的代码就几乎让我崩溃,完全不知道什么意思。
void PairPeriPMB::allocate()
{
allocated = 1;
int n = atom->ntypes;
setflag = memory->create_2d_int_array(n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[j] = 0;
cutsq = memory->create_2d_double_array(n+1,n+1,"pair:cutsq");
kspring = memory->create_2d_double_array(n+1,n+1,"pair:kspring");
s00 = memory->create_2d_double_array(n+1,n+1,"pair:s00");
alpha = memory->create_2d_double_array(n+1,n+1,"pair:alpha");
cut = memory->create_2d_double_array(n+1,n+1,"pair:cut");
} |
|