我已经搜索过该网站,并且我还没有找到对我的问题的答案。在for循环中使用C的fwrite
我的程序输出一个图像,我想保存到一个不同的文件,循环迭代后生成的每个图像。
我的代码保存文件是这样的
FILE *fobjecto;
if ((fobjecto = fopen ("OSEM.ima", "wb")) != NULL)
{
printf("Writing reconstructed image file");
fwrite (objecto, sizeof(float), (detectorXDim)*detectorYDim*(NSlices-1), fobjecto);
fclose (fobjecto);
}
else
printf("Reconstructed image file could not be saved");
我想一个整型变量添加到输出文件的名字,我试图用“+”和玩“”但我不解决这个问题。
在此先感谢
这个数字有多大? – vsz