回复 6楼 TonyDeng
文件就是上面这样的,读取冒号之后的数字,然后赋给c++里面相应的参数没有说明只有数字的时候,我是这么写的:
程序代码:double l, tpmax, dt; //define variables
int n, w, B, C, dif, con; //define variables
ifstream inputdata("parameter.txt"); //open the parameter file
inputdata>>l>>tpmax>>dt>>n>>w>>B>>C>>dif>>con; //read the parameters to the variables
inputdata.close(); //close the parameter file想请教要想前面加上说明,怎么只读冒号后面的数字









