赞
踩
在生成路径时,我们需要将字符串和编号拼接。在python中format很容易生成,在c++中我花了半个小时。。。
int i=0; char path[30]; sprintf(path, "result/node/%d.txt", i);
如果要传入函数,直接传入path就可以。因为字符数组首地址就是数组名。 今天又被我机智到。