![]() |
Troubleshooting with fread and fopen
:
|
Re: Troubleshooting with fread and fopen
Nice code, and thanks for using code tags correctly, but why ????? Sorry, but we are not mind readers, you need to give just a tad more information about the problem is you expect anyone to help you.
|
Re: Troubleshooting with fread and fopen
Apart from the missing braces and the fact that your code isn't actually inside a function, I think the main problem is that you are reading the data into the data1 variable and then trying to access it through the header variable.
|
Re: Troubleshooting with fread and fopen
@ancient dragon
yeah sry bout htat...actually m tryin to verify the sample rate for a 48 kHZ .wav file ,so m tryin to call a hex file saved in my pc and tryin to read the format for RIFF , fmt chunk and the sample rate chunk !! |
Re: Troubleshooting with fread and fopen
@the dark
thnksssss !! well after making the necessary changes the errors that get are " type name expected " "Variable 'fp' is initalized more than once" |
Re: Troubleshooting with fread and fopen
It sounds a bit like you have made almost all the necessary changes :)
Can you post your current code, along with the line numbers for the errors? |
Re: Troubleshooting with fread and fopen
Now i am able to run the code but m unable to open my wave file,are my 'fopen' and 'fread' commands proper !!
:
#include<stdio.h> |
Re: Troubleshooting with fread and fopen
You should return 0 when the program exits successfully and 1 otherwise, not the other way around.
|
Re: Troubleshooting with fread and fopen
:
FILE *wavfile;You are re-assigning wavfile twice after you open the first file. When you do this, the pointer to the other files gets lost. |
Re: Troubleshooting with fread and fopen
{
FILE *wavfile; FILE *wavfile1; FILE *wavfile2; wavfile =fopen("cwav1.wav", "rb"); wavfile1 =fopen("cwav2.wav", "rb"); wavfile1 =fopen("cwav3.wav", "rb"); if(wavfile ==NULL)|| if(wavfile1== NULL)|| if(wavfile ==NULL) ----- it gives me 1 error at if statement sayin expression syntax error------ |
| All times are GMT -5. The time now is 4:08 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC