下列代码的含义double* xyz_scale = 0;if (strcmp(argv[i],"-scale") == 0){xyz_scale = new double[3];\x05\x05\x05i++;\x05\x05\x05sscanf(argv[i],"%lf",&(xyz_scale[2]));\x05\x05\x05xyz_scale[0] = xyz_scale[1] = xyz_scale[2];}

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/08 01:37:57
下列代码的含义double*xyz_scale=0;if(strcmp(argv[i],"-scale")==0){xyz_scale=newdouble[3];\x05\x05\x05i++;\x0

下列代码的含义double* xyz_scale = 0;if (strcmp(argv[i],"-scale") == 0){xyz_scale = new double[3];\x05\x05\x05i++;\x05\x05\x05sscanf(argv[i],"%lf",&(xyz_scale[2]));\x05\x05\x05xyz_scale[0] = xyz_scale[1] = xyz_scale[2];}
下列代码的含义
double* xyz_scale = 0;
if (strcmp(argv[i],"-scale") == 0)
{
xyz_scale = new double[3];
\x05\x05\x05i++;
\x05\x05\x05sscanf(argv[i],"%lf",&(xyz_scale[2]));
\x05\x05\x05xyz_scale[0] = xyz_scale[1] = xyz_scale[2];
}

下列代码的含义double* xyz_scale = 0;if (strcmp(argv[i],"-scale") == 0){xyz_scale = new double[3];\x05\x05\x05i++;\x05\x05\x05sscanf(argv[i],"%lf",&(xyz_scale[2]));\x05\x05\x05xyz_scale[0] = xyz_scale[1] = xyz_scale[2];}
argv应该是命令行参数,比较每一个(这个代码应该在for语句之中)参数是否是"-scale",如果不是(==0),创建double指针数组,并将参数赋值给这个数组.