谁能帮我解释这段代码?谢谢各位了。。。
#include "stdafx.h"#include <stdio.h>
#include <stdlib.h>
#define LenP 160
int _tmain(int argc, _TCHAR* argv[])
{
long fSize = 0;
short * buffer;
short tmp[LenP];
size_t result;
int cnt =1;
FILE *pFile = fopen("test.pcm","rb");
FILE *poutput = fopen("result.pcm","wb");
if(pFile == NULL)
{
printf("not found file\n");
return 0;
}
while(cnt=fread(tmp, sizeof(short), LenP, pFile))
{
for(int i=0; i<LenP; i++)
{
tmp[i] = tmp[i] * 2;
}
fwrite(tmp, sizeof(short), LenP, poutput);
}
fclose(pFile);
fclose(poutput);
return 0;
}
[ 本帖最后由 qingfu33 于 2012-2-7 19:47 编辑 ]