我将以下内容存储在 char 数组中
"1, 1.0, 1.000, 1.0000"
我正在尝试将其解析为一个 int 和三个双精度数,如下所示
sscanf(myString, "%d %lf %lf %lf", &(myStruct->I1), &(myStruct->D1), &(myStruct->D2), &(myStruct->D3);
printf("%d %lf %lf %lf", myStruct->I1, myStruct->D1, myStruct->D2, myStruct->D3);
输出
1 0.000000 0.000000 0.000000