如何在Windows中的c / c ++中将double类型写入文件?

时间:2010-09-05 03:47:20

标签: c++ syntax

double Time;
...
WriteFile( tmp_pipe, Time, sizeof(double), &dwWritten, NULL );

以上报告:

error C2664: 'WriteFile' : cannot convert parameter 2 from 'double' to 'LPCVOID'

1 个答案:

答案 0 :(得分:2)

对于函数调用的参数2,您需要&Time,而不是Time