when i changed them what you suggest it results run time error;
void saveRecord(short *record)
{
FILE *f;
int bitsPerSample = 16;
int subchunk1size = 16;
int numChannels = 1;
int subchunk2size = bufnum * numChannels;
int sampleRate = 44100;
int chunksize = 36+subchunk2size;
int audioFormat = 1;
int byteRate = sampleRate*numChannels*bitsPerSample/8;
int blockAlign = numChannels*bitsPerSample/8;
printf("bufnum : %d", bufnum);
f = fopen("word.wav", "wb");
fwrite("RIFF",1, 4, f);
fwrite((char*) &chunksize, 1, 4, f);
fwrite("WAVE",1, 4, f);
fwrite("fmt ",1, 4, f);
fwrite((char*) &subchunk1size, 1, 4, f);
fwrite((char*) &audioFormat, 1, 4, f);
fwrite((char*) &numChannels, 1, 4, f);
fwrite((char*) &sampleRate, 1, 4, f);
fwrite((char*) &byteRate, 1, 4, f);
fwrite((char*) &blockAlign, 1, 4, f);
fwrite((char*) &bitsPerSample, 1, 2, f);
fwrite("data", 1, 4, f);
fwrite((char*) &subchunk2size, 1, 4, f);
fwrite((char *)record,1, bufnum, f);
fclose(f);
}