Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/134.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ C+中的数据提取+;_C++ - Fatal编程技术网

C++ C+中的数据提取+;

C++ C+中的数据提取+;,c++,C++,大家好,我正在使用代码从数据文件中读取 //................ //................... char databuff[20]; char ch; for(int i=0;i<15;i++) { f[0].getline(databuff,((2*sizeof(double))+(2*sizeof(char)))); //............... //............... cDisp

大家好,我正在使用代码从数据文件中读取

//................  
//...................  
char databuff[20];  
char ch;  
for(int i=0;i<15;i++)  {  
    f[0].getline(databuff,((2*sizeof(double))+(2*sizeof(char))));  
    //...............  
    //...............
    cDisp=databuff;  
    cDisp1+=cDisp;  
    cDisp1+="\r\n";  
}  
GetDlgItem(IDC_DISPLAYFILE)->SetWindowTextW(cDisp1);  
/。。。。。。。。。。。。。。。。
//...................  
char-databuff[20];
char ch;
对于(int i=0;iSetWindowTextW(cDisp1);
现在数据似乎是两个双浮点数,由“
”分隔,“

如何从我在代码中使用的databuff中提取两个不同双变量中的两个双值?程序的输出如下……
0334.152
0.013333334.152
0.02667334.143
0.04334.143
0.0533334.134
0.06667334.125
0.08334.125
0.0933334.125
0.106667334.116
0.12334.116
0.13333334.116
0.14667334.116
0.16334.125
0.1733334.134

0.186667334.431

您可以在数据缓冲区的顶部创建一个strstrstream,只需使用双d0,d1;chart;str>>d0>>t>>d1;


可选的,你可以尝试<代码> Strugr <代码>来定位“,”,然后在两个子串上使用<<代码> <代码>:(STD::如果你想要C++模式),请你建议我如何在数据包上使用StruChr?我的程序的输出类似于334.152。