Ok so you might remember a while ago I wanted to do some DSP in C++. Since uni work weighed me down I couldnt really do much with it. I rebuilt the code now just to do a basic function of reading the RIFF header. Then I will focus on trying the DSP stuff.
So I built it after much hard work and a little external help. It SHOULD work but for some reason when I try to execute it the file pointer is not working. The Error reporting is working a treat though
Im working in Xcode by the way.
So here is an extract of a bit of my code. The first section is the error return when something doesnt work. This section actually works. The second bit is the file pointer section which is supposed to open the wav file. But every time i execute it returns the error:
int errormessage(const char* msg, int error = 0)
cout << msg << endl;
while(cin.get() != 10);
FILE *fp = NULL;
fp = fopen("test.wav", "r");
return errormessage("Error: Cannot Open File");
I have the wav file named as "test.wav" and its in the same location as the build (which is: /Users/jtjbranston/Documents/Programming/ReadRIFFHeader/build/Debug/)
Am I missing something with the file pointer here? If you need the entire code I can supply (I dont see why you would though)
Thanks. Hope all is well.