我编写了计算乘法矩阵时间的函数。那是代码:
if ((file = fopen("../logs.txt","w")) != NULL)
{
for(int i = 0; i < 5; ++i)
{
if(QueryPerformanceCounter(&start) !=0)
{
mult(m1, m2, m3);
QueryPerformanceCounter(&finish);
double temp = (double)(finish.QuadPart - start.QuadPart)/frequency.QuadPart;
if(temp<=min || min == 0)
min = temp;
}
}
fwrite(&min, sizeof(min), 1, file);
fclose(file);
}
当我调试它时,我看到我的最小时间等于 0.26336317888614069,但在文件中它写成“2W<сЪР?”。请告诉我有什么问题。